do not send messages on every login

This commit is contained in:
DaZZZl 2015-11-10 14:00:38 +01:00
parent 40495601ed
commit bcd5e7e541
2 changed files with 3 additions and 5 deletions

2
bot.py
View file

@ -205,7 +205,7 @@ following user commands are available:
except KeyError: except KeyError:
nick = buddy 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): def _getgroups(self):
#self.session.call("group_getGroups", ("participating",)) #self.session.call("group_getGroups", ("participating",))
self.session.requestGroupsList(self.session._updateGroups) self.session.requestGroupsList(self.session._updateGroups)

View file

@ -130,7 +130,7 @@ class Session(YowsupApp):
self.backend.handleRoomList(rooms) self.backend.handleRoomList(rooms)
message = "Note, you are a participant of the following groups:\n" +\ message = "Note, you are a participant of the following groups:\n" +\
'\n'.join(text) + '\nIf you do not join them you will lose messages' '\n'.join(text) + '\nIf you do not join them you will lose messages'
self.bot.send(message) #self.bot.send(message)
def updateRoster(self): def updateRoster(self):
self.logger.debug("Update roster") self.logger.debug("Update roster")
@ -267,7 +267,6 @@ class Session(YowsupApp):
if self.initialized == False: if self.initialized == False:
self.sendOfflineMessages() self.sendOfflineMessages()
#self.bot.call("welcome") #self.bot.call("welcome")
self.bot.call("welcome")
self.initialized = True self.initialized = True
self.sendPresence(True) self.sendPresence(True)
self.updateRoster() self.updateRoster()
@ -414,8 +413,7 @@ class Session(YowsupApp):
self.sendMessageToXMPP(buddy, url, location.timestamp) self.sendMessageToXMPP(buddy, url, location.timestamp)
self.sendMessageToXMPP(buddy, 'geo:' + latitude + ',' + longitude, self.sendMessageToXMPP(buddy, 'geo:' + latitude + ',' + longitude,
location.timestamp) location.timestamp)
self.sendReceipt(location._id, location._from, None, location.participant) self.sendReceipt(location._id, location._from, None, location.participant, location.timestamp)
location.timestamp)
# Called by superclass # Called by superclass