Mercurial > libervia-backend
diff frontends/src/quick_frontend/quick_chat.py @ 812:084b52afdceb
frontends: fixed /me usage + renamed a couple of "type" parameters to type_
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 04 Feb 2014 18:51:16 +0100 |
parents | 1fe00f0c9a91 |
children | cd02f5ef30df |
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_chat.py Tue Feb 04 18:32:49 2014 +0100 +++ b/frontends/src/quick_frontend/quick_chat.py Tue Feb 04 18:51:16 2014 +0100 @@ -26,19 +26,19 @@ class QuickChat(object): - def __init__(self, target, host, type='one2one'): + def __init__(self, target, host, type_='one2one'): self.target = target self.host = host - self.type = type + self.type = type_ self.id = "" self.nick = None self.occupants = set() - def setType(self, type): + def setType(self, type_): """Set the type of the chat @param type: can be 'one2one' for single conversation or 'group' for chat à la IRC """ - self.type = type + self.type = type_ def setPresents(self, nicks): """Set the users presents in the contact list for a group chat @@ -130,14 +130,14 @@ nick = self._get_nick(jid) mymess = (jid.resource == self.nick) if self.type == "group" else (jid.bare == self.host.profiles[profile]['whoami'].bare) #mymess = True if message comes from local user if msg.startswith('/me '): - self.printInfo('* %s %s' % (nick, msg[4:]),type='me', timestamp=timestamp) + self.printInfo('* %s %s' % (nick, msg[4:]), type_='me', timestamp=timestamp) return return jid, nick, mymess - def printInfo(self, msg, type='normal'): + def printInfo(self, msg, type_='normal'): """Print general info @param msg: message to print - @type: one of: + @type_: one of: normal: general info like "toto has joined the room" me: "/me" information like "/me clenches his fist" ==> "toto clenches his fist" """