Fix message omitting bug in owner chat
The message content of an incoming connect message was not displayed because
the connection URI could not be found. Added a fallback to check for the connection URI
in our envelope via 'hasReceiver'
@@ -385,11 +385,17 @@ function parseMessage(jsonldMessage, outgoingMessage, newMessage) {
if(fromCorrespondingMessage){
// if message comes within the events of showLatestMessages/showMoreMessages action
- parsedMessage.belongsToUri = fromCorrespondingMessage.get("hasReceiver");
+ // in case of a connect message, the receiver (=connection URI)
+ // is not in the message sent by the remote need (because there is no connection yet)
+ // here, we try to fall back to the message copy received by our need if we fail to find a receiver
+ let receiver = fromCorrespondingMessage.get("hasReceiver");
+ if (!receiver) {
+ receiver = jsonldMessageImm.get("hasReceiver");
+ }
+ parsedMessage.belongsToUri = receiver;
parsedMessage.data.uri = fromCorrespondingMessage.get("uri");
parsedMessage.data.text = fromCorrespondingMessage.get("hasTextMessage");
parsedMessage.data.date = msStringToDate(jsonldMessageImm.getIn(["hasReceivedTimestamp"]));
-
if(fromCorrespondingMessage.get("hasMessageType") === won.WONMSG.connectMessage){
parsedMessage.data.connectMessage = true;
}
