Mercurial > libervia-backend
comparison frontends/src/primitivus/contact_list.py @ 1408:8a7145138330
quick_frontend, primitivus: move code to remove a new message alert from primitivus to quick_frontend
author | souliane <souliane@mailoo.org> |
---|---|
date | Thu, 16 Apr 2015 13:31:14 +0200 |
parents | 069ad98b360d |
children | 683b76c1145d |
comparison
equal
deleted
inserted
replaced
1407:77f07ea90420 | 1408:8a7145138330 |
---|---|
134 If True, all jids in self._alerts with the same bare jid has contact_wid.data will be removed | 134 If True, all jids in self._alerts with the same bare jid has contact_wid.data will be removed |
135 @param contact_wid: widget of the contact, must have the entity set in data attribute | 135 @param contact_wid: widget of the contact, must have the entity set in data attribute |
136 @param selected: boolean returned by the widget, telling if it is selected | 136 @param selected: boolean returned by the widget, telling if it is selected |
137 """ | 137 """ |
138 entity = contact_wid.data | 138 entity = contact_wid.data |
139 if use_bare_jid: | 139 self.removeAlert(entity, use_bare_jid) |
140 to_remove = set() | |
141 for alert_entity in self._alerts: | |
142 if alert_entity.bare == entity.bare: | |
143 to_remove.add(alert_entity) | |
144 self._alerts.difference_update(to_remove) | |
145 else: | |
146 self._alerts.discard(entity) | |
147 self.host.modeHint(C.MODE_INSERTION) | 140 self.host.modeHint(C.MODE_INSERTION) |
148 self.update() | |
149 self._emit('click', entity) | 141 self._emit('click', entity) |
150 | 142 |
151 def onNickUpdate(self, entity, new_nick, profile): | 143 def onNickUpdate(self, entity, new_nick, profile): |
152 self.update() | 144 self.update() |
153 | 145 |