Adds helper method to determine if a connection is a groupChatConnection
import won from "./won-es6.js";
/**
- * Determines if a given connection is a chatConnection
+ * Determines if a given connection is a chatConnection or a groupChatConnection
* @param msg
* @returns {*|boolean}
*/
@@ -14,6 +14,19 @@ export function isChatConnection(conn) {
conn &&
conn.get("facet") &&
(conn.get("facet") === won.WON.ChatFacetCompacted ||
- conn.get("facet") === won.WON.GroupFacetCompacted)
+ isGroupChatConnection(conn))
+ );
+}
+
+/**
+ * Determines if a given connection is a groupChatConnection
+ * @param msg
+ * @returns {*|boolean}
+ */
+export function isGroupChatConnection(conn) {
+ return (
+ conn &&
+ conn.get("facet") &&
+ conn.get("facet") === won.WON.GroupFacetCompacted
);
}
