- "my-chatmsg": chat.name == this.st.user.name,
- "opp-chatmsg": !!this.players && this.players.some(
- p => p.name == chat.name && p.name != this.st.user.name)
+ "my-chatmsg": (
+ !!chat.name && chat.name == this.st.user.name ||
+ !!chat.sid && chat.sid == this.st.user.sid
+ ),
+ "opp-chatmsg":
+ !!this.players &&
+ this.players.some(
+ p => {
+ return (
+ (
+ !!p.name &&
+ p.name == chat.name &&
+ p.name != this.st.user.name
+ )
+ ||
+ (
+ !!p.sid &&
+ p.sid == chat.sid &&
+ p.sid != this.st.user.sid
+ )
+ );
+ }
+ )