OfficeDev / skype-web-sdk-samples

Other
116 stars 76 forks source link

Message sent appears twice in chat-service script #11

Open ImLemni opened 8 years ago

ImLemni commented 8 years ago

Hello, I am just trying to see how the SDK works, I have launched the chat-service while logged as fernando@metio.net (as mentionned in the msdn doc ). I then tried to chat with my personnal skype fo business acount. I can send and receive message but the message sent appears twice (but send only once). I resolve the problem by changing this function : https://github.com/OfficeDev/skype-web-sdk-samples/blob/master/SkypeWebSDKOnlineSample/UI/samples/scripts/chat-service.js#L97 by that :

 conversation.historyService.activityItems.added(function(message) {
    if (message.type() == 'TextMessage') {
        if (message.direction() == 'Incoming' ) {
            historyAppend(XMessage(message));
        } else if (message.direction() == 'Outgoing' && message.status() === "Succeeded") {
                historyAppend(XMessage(message));
        }
   }

});

The message was first appended to the chat zone because of the "Pending" message, then added again because of the "Succeedeed" message. I don't know if it's a legit way to handle this issue, but it may help.

sidharthv commented 8 years ago

Thank you for pointing this out. We will fix this.

abdoutelb commented 8 years ago

@ImLemni actually i made the extra condition but it seems that message arrive on the other side but not writing on my side.

oliverdinh commented 7 years ago

Hi @sidharthv : Is this issue solved? I'm facing with it on latest version of SDK. Thank you!