|
@@ -1063,17 +1063,21 @@ export default class ChatRoom extends Listenable {
|
1063
|
1063
|
from, invite.attr('from'), txt, password);
|
1064
|
1064
|
}
|
1065
|
1065
|
}
|
|
1066
|
+
|
1066
|
1067
|
const jsonMessage = $(msg).find('>json-message').text();
|
1067
|
|
- const parsedJson = this.xmpp.tryParseJSONAndVerify(jsonMessage);
|
1068
|
1068
|
|
1069
|
|
- // We emit this event if the message is a valid json, and is not
|
1070
|
|
- // delivered after a delay, i.e. stamp is undefined.
|
1071
|
|
- // e.g. - subtitles should not be displayed if delayed.
|
1072
|
|
- if (parsedJson && stamp === undefined) {
|
1073
|
|
- this.eventEmitter.emit(XMPPEvents.JSON_MESSAGE_RECEIVED,
|
1074
|
|
- from, parsedJson);
|
|
1069
|
+ if (jsonMessage) {
|
|
1070
|
+ const parsedJson = this.xmpp.tryParseJSONAndVerify(jsonMessage);
|
1075
|
1071
|
|
1076
|
|
- return;
|
|
1072
|
+ // We emit this event if the message is a valid json, and is not
|
|
1073
|
+ // delivered after a delay, i.e. stamp is undefined.
|
|
1074
|
+ // e.g. - subtitles should not be displayed if delayed.
|
|
1075
|
+ if (parsedJson && stamp === undefined) {
|
|
1076
|
+ this.eventEmitter.emit(XMPPEvents.JSON_MESSAGE_RECEIVED,
|
|
1077
|
+ from, parsedJson);
|
|
1078
|
+
|
|
1079
|
+ return;
|
|
1080
|
+ }
|
1077
|
1081
|
}
|
1078
|
1082
|
|
1079
|
1083
|
if (txt) {
|