diff --git a/adaptor-xmpp.js b/adaptor-xmpp.js index 136c525..a278b85 100644 --- a/adaptor-xmpp.js +++ b/adaptor-xmpp.js @@ -107,6 +107,23 @@ function sendMessage(destination, msg) { } xmpp.send(destination, msg); + + if (!matrix) { + return; + } + + if (!matrix.buddies) { + matrix.buddies = {}; + } + + if (!matrix.buddies[destination]) { + matrix.buddies[destination] = {}; + } + + matrix.buddies[destination].lastOutgoing = { + msg: msg, + lastUpdate: moment().format('YYYY-MM-DD HH:mm:ss') + } } function addFriend(friend) {