From fb48d75a33f8024da2efce413301418c4cb672b7 Mon Sep 17 00:00:00 2001 From: Adhidarma Hadiwinoto <me@adhisimon.org> Date: Thu, 27 Oct 2016 11:47:32 +0700 Subject: [PATCH] lastOutgoing --- adaptor-xmpp.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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) { -- 1.9.0