兩次使用Skype SDK Here這裏是我的代碼片段消息顯示使用Skype SDK聊天
config.conversation.historyService.activityItems.added(function(newMsg) {
if(typeof newMsg.direction != 'function') {} else {
if(newMsg.direction() == 'Incoming') {
direction = "black";
} else if(newMsg.direction() == 'Outgoing' && newMsg.status() === "Succeeded") {
direction = "green";
} else {}
$("#conversationText").append('<br/><div class="chat-user-info"><h1 class="chat-user-name">' + newMsg.sender.displayName() + '</h1><h2 class="chat-user-time">' + new Date() + '</h2></div><div class="chat-user-message"><h3 style="color:' + direction + ';">' + newMsg.text() + '</h3></div><br/>');
}
});
但是,當它是在國家尚未了結或即使失敗後出現的消息,在此之後我嘗試把消息放在裏面,但它只出現在另一邊,而不是我的。
Github上相關的問題Here
感謝回答....我寫這個條件是因爲它監聽事件兩次,一次是針對baseModel對象,另一個是針對Message對象......其中一個拋出異常,如果沒有處理它 – abdoutelb
好吧,我沒有看到這種類型的錯誤,但我認爲他們已經改變了例子a位。 您是否嘗試過使用我的解決方案打印一些日誌? 嘗試打印每個時間的狀態和方向 – Lemni
對於遲到抱歉,我測試了你的代碼實際上消息狀態可能是「等待中」 - 「待定」,那麼它「成功」或「失敗」,在成功或失敗的情況下,發送給對方。所以它不能寫在我身邊,但在那裏傳遞。 – abdoutelb