From be363af3c0b02fce454470e1c0a364e619b1b261 Mon Sep 17 00:00:00 2001
From: Adhidarma Hadiwinoto <me@adhisimon.org>
Date: Thu, 27 Oct 2016 19:05:11 +0700
Subject: [PATCH] hapus undefined resource jika ada resource lain

---
 adaptor-xmpp.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/adaptor-xmpp.js b/adaptor-xmpp.js
index 12cba77..08d8e65 100644
--- a/adaptor-xmpp.js
+++ b/adaptor-xmpp.js
@@ -81,6 +81,13 @@ function onBuddy(jid, state, statusText, resource) {
         statusText: statusText,
         lastUpdate: moment().format('YYYY-MM-DD HH:mm:ss')
     }
+
+    if (resource != 'undefined' && matrix.buddies[jid].resources.undefined) {
+        try {
+            delete matrix.buddies[jid].resources.undefined;
+        }
+        catch(e) {};
+    }
 }
 
 function isPartnerOffline(partner) {
-- 
1.9.0