@@ -22,6 +22,7 @@ public function run() {
22
22
$ dispatcher ->listen ('chat.data_changed_chat ' , array ( $ this ,'messageReceived ' ));
23
23
$ dispatcher ->listen ('chat.screenshot_ready ' , array ( $ this ,'messageReceived ' ));
24
24
25
+ $ dispatcher ->listen ('chat.stream_flow ' , array ( $ this ,'streamFlow ' ));
25
26
$ dispatcher ->listen ('chat.web_add_msg_admin ' , array ( $ this ,'messageReceivedAdmin ' ));
26
27
$ dispatcher ->listen ('chat.added_operation ' , array ( $ this ,'messageReceivedAdmin ' ));
27
28
$ dispatcher ->listen ('chat.chatwidgetchat ' , array ( $ this ,'messageReceived ' ));
@@ -124,6 +125,16 @@ public function __get($var)
124
125
}
125
126
}
126
127
128
+
129
+
130
+ public function streamFlow ($ params ) {
131
+ if (erLhcoreClassModule::getExtensionInstance ('erLhcoreClassExtensionNodejshelper ' )->getSettingVariable ('automated_hosting ' )){
132
+ erLhcoreClassNodeJSRedis::instance ()->publish ('chat_ ' . erLhcoreClassInstance::getInstance ()->id . '_ ' . $ params ['chat ' ]->id ,'o: ' . json_encode (array ('msg ' => $ params ['response ' ]['content ' ], 'op ' => 'sflow ' )));
133
+ } else {
134
+ erLhcoreClassNodeJSRedis::instance ()->publish ('chat_ ' . $ params ['chat ' ]->id ,'o: ' . json_encode (array ('msg ' => $ params ['response ' ]['content ' ], 'op ' => 'sflow ' )));
135
+ }
136
+ }
137
+
127
138
public function messageReceivedAdmin ($ params ) {
128
139
if (isset ($ params ['ou ' ]) && $ params ['ou ' ] instanceof erLhcoreClassModelChatOnlineUser && $ params ['chat ' ]->user_status == erLhcoreClassModelChat::USER_STATUS_PENDING_REOPEN ) {
129
140
erLhcoreClassNodeJSRedis::instance ()->publish ('uo_ ' . $ params ['ou ' ]->vid ,'o: ' . json_encode (array ('op ' => 'check_message ' )));
0 commit comments