From bcd5e7e54161109f2affa8df107ca39101f9dec2 Mon Sep 17 00:00:00 2001 From: DaZZZl Date: Tue, 10 Nov 2015 14:00:38 +0100 Subject: [PATCH] do not send messages on every login --- bot.py | 2 +- session.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index 469dd78..85d4ae7 100644 --- a/bot.py +++ b/bot.py @@ -205,7 +205,7 @@ following user commands are available: except KeyError: nick = buddy - self.send(self.session.groups[group].id + "@transwhat.xmpp.ewg.2y.net " + self.session.groups[group].subject + " Owner: " + nick ) + self.send(self.session.groups[group].id + self.session.backend.spectrum_jid + " " + self.session.groups[group].subject + " Owner: " + nick ) def _getgroups(self): #self.session.call("group_getGroups", ("participating",)) self.session.requestGroupsList(self.session._updateGroups) diff --git a/session.py b/session.py index c80072f..204c614 100644 --- a/session.py +++ b/session.py @@ -130,7 +130,7 @@ class Session(YowsupApp): self.backend.handleRoomList(rooms) message = "Note, you are a participant of the following groups:\n" +\ '\n'.join(text) + '\nIf you do not join them you will lose messages' - self.bot.send(message) + #self.bot.send(message) def updateRoster(self): self.logger.debug("Update roster") @@ -267,7 +267,6 @@ class Session(YowsupApp): if self.initialized == False: self.sendOfflineMessages() #self.bot.call("welcome") - self.bot.call("welcome") self.initialized = True self.sendPresence(True) self.updateRoster() @@ -414,8 +413,7 @@ class Session(YowsupApp): self.sendMessageToXMPP(buddy, url, location.timestamp) self.sendMessageToXMPP(buddy, 'geo:' + latitude + ',' + longitude, location.timestamp) - self.sendReceipt(location._id, location._from, None, location.participant) - location.timestamp) + self.sendReceipt(location._id, location._from, None, location.participant, location.timestamp) # Called by superclass