comparison frontends/src/primitivus/primitivus @ 2008:8a749ec21c50

primitivus: fixed notifications counter for simple messages in MUC rooms
author Goffi <goffi@goffi.org>
date Sun, 17 Jul 2016 17:12:42 +0200
parents dbe025b03eba
children 53587e738aca
comparison
equal deleted inserted replaced
2007:19b9d3f8a6c7 2008:8a749ec21c50
604 def notify(self, type_, entity=None, message=None, subject=None, callback=None, cb_args=None, widget=None, profile=C.PROF_KEY_NONE): 604 def notify(self, type_, entity=None, message=None, subject=None, callback=None, cb_args=None, widget=None, profile=C.PROF_KEY_NONE):
605 if widget is None or widget is not None and widget != self.selected_widget: 605 if widget is None or widget is not None and widget != self.selected_widget:
606 # we ignore notification if the widget is selected but we can 606 # we ignore notification if the widget is selected but we can
607 # still do a desktop notification is the X window has not the focus 607 # still do a desktop notification is the X window has not the focus
608 super(PrimitivusApp, self).notify(type_, entity, message, subject, callback, cb_args, widget, profile) 608 super(PrimitivusApp, self).notify(type_, entity, message, subject, callback, cb_args, widget, profile)
609 if not self.x_notify.hasFocus(): 609 # we don't want notifications without message on desktop
610 if message is not None and not self.x_notify.hasFocus():
610 if message is None: 611 if message is None:
611 message = _("{app}: a new event has just happened{entity}").format( 612 message = _("{app}: a new event has just happened{entity}").format(
612 app=C.APP_NAME, 613 app=C.APP_NAME,
613 entity=u' ({})'.format(entity) if entity else '') 614 entity=u' ({})'.format(entity) if entity else '')
614 self.x_notify.sendNotification(message) 615 self.x_notify.sendNotification(message)