Mercurial > libervia-backend
diff frontends/src/primitivus/chat.py @ 507:f98bef71a918
frontends, core, plugin XEP-0045: leave implementation + better nick change
- memory: individual entity cache can be deleted
- plugin XEP-0045: nick change are now detected and userChangedNick signal is sent instead of joined/left
- plugin XEP-0045: leave implementation
- frontends: userChangedNick signal management
- Primitivus: an alert is shown in notification bar in case of error in sendMessage
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 28 Sep 2012 00:26:24 +0200 |
parents | e9634d2e7b38 |
children | 886754295efe |
line wrap: on
line diff
--- a/frontends/src/primitivus/chat.py Thu Sep 27 00:54:42 2012 +0200 +++ b/frontends/src/primitivus/chat.py Fri Sep 28 00:26:24 2012 +0200 @@ -203,10 +203,10 @@ self.present_wid.changeValues(nicks) self.host.redraw() - def replaceUser(self, param_nick): + def replaceUser(self, param_nick, show_info=True): """Add user if it is not in the group list""" nick = unicode(param_nick) #FIXME: should be done in DBus bridge - QuickChat.replaceUser(self, nick) + QuickChat.replaceUser(self, nick, show_info) presents = self.present_wid.getAllValues() if nick not in presents: presents.append(nick) @@ -214,10 +214,10 @@ self.present_wid.changeValues(presents) self.host.redraw() - def removeUser(self, param_nick): + def removeUser(self, param_nick, show_info=True): """Remove a user from the group list""" nick = unicode(param_nick) #FIXME: should be done in DBus bridge - QuickChat.removeUser(self, nick) + QuickChat.removeUser(self, nick, show_info) self.present_wid.deleteValue(nick) self.host.redraw() @@ -234,11 +234,11 @@ #as that mean that he is probably watching discussion history self.text_list.set_focus(len(self.content)-1) self.host.redraw() - if not self.host.notify.hasFocus(): + if not self.host.x_notify.hasFocus(): if self.type=="one2one": - self.host.notify.sendNotification(_("Primitivus: %s is talking to you") % from_jid) + self.host.x_notify.sendNotification(_("Primitivus: %s is talking to you") % from_jid) elif self.getUserNick().lower() in msg.lower(): - self.host.notify.sendNotification(_("Primitivus: Somebody pinged your name in %s room") % self.target) + self.host.x_notify.sendNotification(_("Primitivus: Somebody pinged your name in %s room") % self.target) def printInfo(self, msg, type='normal'): """Print general info @@ -253,11 +253,11 @@ #as that mean that he is probably watching discussion history self.text_list.set_focus(len(self.content)-1) self.host.redraw() - if not self.host.notify.hasFocus(): + if not self.host.x_notify.hasFocus(): if self.type=="one2one": - self.host.notify.sendNotification(_("Primitivus: there is a message about you")) + self.host.x_notify.sendNotification(_("Primitivus: there is a message about you")) elif self.getUserNick().lower() in msg.lower(): - self.host.notify.sendNotification(_("Primitivus: Somebody is talking about you in %s room") % self.target) + self.host.x_notify.sendNotification(_("Primitivus: Somebody is talking about you in %s room") % self.target) def startGame(self, game_type, referee, players): """Configure the chat window to start a game"""