Commit fb48d75a33f8024da2efce413301418c4cb672b7

Authored by Adhidarma Hadiwinoto
1 parent 5627a4c111
Exists in master

lastOutgoing

Showing 1 changed file with 17 additions and 0 deletions Side-by-side Diff

... ... @@ -107,6 +107,23 @@ function sendMessage(destination, msg) {
107 107 }
108 108  
109 109 xmpp.send(destination, msg);
  110 +
  111 + if (!matrix) {
  112 + return;
  113 + }
  114 +
  115 + if (!matrix.buddies) {
  116 + matrix.buddies = {};
  117 + }
  118 +
  119 + if (!matrix.buddies[destination]) {
  120 + matrix.buddies[destination] = {};
  121 + }
  122 +
  123 + matrix.buddies[destination].lastOutgoing = {
  124 + msg: msg,
  125 + lastUpdate: moment().format('YYYY-MM-DD HH:mm:ss')
  126 + }
110 127 }
111 128  
112 129 function addFriend(friend) {