Mercurial > libervia-backend
comparison frontends/src/quick_frontend/quick_chat.py @ 1786:104874018ab0
quick_frontend, primitivus (chat): move notification command to quick_frontend
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 12 Jan 2016 17:52:17 +0100 |
parents | d17772b0fe22 |
children | 2daf7b4c6756 |
comparison
equal
deleted
inserted
replaced
1785:ac73d7456abc | 1786:104874018ab0 |
---|---|
230 @param nick (unicode): author nick | 230 @param nick (unicode): author nick |
231 @param my_message (boolean): True if profile is the author | 231 @param my_message (boolean): True if profile is the author |
232 @param message (unicode): message content | 232 @param message (unicode): message content |
233 @param extra (dict): extra data | 233 @param extra (dict): extra data |
234 """ | 234 """ |
235 raise NotImplementedError | 235 if not timestamp: |
236 # XXX: do not send notifications for each line of the history being displayed | |
237 # FIXME: this must be changed in the future if the timestamp is passed with | |
238 # all messages and not only with the messages coming from the history. | |
239 self.notify(nick, message) | |
236 | 240 |
237 def printInfo(self, msg, type_='normal', extra=None): | 241 def printInfo(self, msg, type_='normal', extra=None): |
238 """Print general info. | 242 """Print general info. |
239 | 243 |
240 @param msg (unicode): message to print | 244 @param msg (unicode): message to print |
241 @param type_ (unicode): | 245 @param type_ (unicode): |
242 - 'normal': general info like "toto has joined the room" | 246 - 'normal': general info like "toto has joined the room" |
243 - 'me': "/me" information like "/me clenches his fist" ==> "toto clenches his fist" | 247 - 'me': "/me" information like "/me clenches his fist" ==> "toto clenches his fist" |
244 @param extra (dict): message data | 248 @param extra (dict): message data |
245 """ | 249 """ |
246 raise NotImplementedError | 250 self.notify(msg=msg) |
251 | |
252 def notify(self, contact="somebody", msg=""): | |
253 """Notify the user of a new message if the frontend doesn't have the focus. | |
254 | |
255 @param contact (unicode): contact who wrote to the users | |
256 @param msg (unicode): the message that has been received | |
257 """ | |
258 raise NotImplemented | |
247 | 259 |
248 def printDayChange(self, day): | 260 def printDayChange(self, day): |
249 """Display the day on a new line. | 261 """Display the day on a new line. |
250 | 262 |
251 @param day(unicode): day to display (or not if this method is not overwritten) | 263 @param day(unicode): day to display (or not if this method is not overwritten) |