def __addClubInvites(self): model = self._model() profile = self.clubsCtrl.getProfile() if model is None or not profile.isInvitesAvailable(): return model.removeNotificationsByType(NOTIFICATION_TYPE.CLUB_INVITE) invites = profile.getInvites().values() invites = sorted(invites, cmp=lambda invite, other: cmp(invite.getTimestamp(), other.getTimestamp())) activeInvites = filter(operator.methodcaller('isActive'), invites) if len(activeInvites): showInvitationInWindowsBar() for invite in invites: model.addNotification(ClubInviteDecorator(invite))
def onAccountClubInvitesChanged(self, added, removed, changed): model = self._model() if model is None: return if len(added): showInvitationInWindowsBar() for invite in removed: model.removeNotification(NOTIFICATION_TYPE.CLUB_INVITE, invite.getID()) for invite in added: model.addNotification(ClubInviteDecorator(invite)) for invite in changed: model.updateNotification(NOTIFICATION_TYPE.CLUB_INVITE, invite.getID(), invite, True)
def __doNotify(self): haveInvites = False for invite in prb_seqs.AutoInvitesIterator(): prbID = invite.prbID haveInvites = True if prbID in self.__notified: continue if not len(invite.description): continue g_eventDispatcher.fireAutoInviteReceived(invite) showInvitationInWindowsBar() self.__notified.add(prbID) if not haveInvites: self.__notified.clear()
def __doNotify(self): haveInvites = False for invite in prb_seqs.AutoInvitesIterator(): prbID = invite.prbID haveInvites = True if prbID in self.__notified: continue if not invite.description: continue g_eventDispatcher.fireAutoInviteReceived(invite) showInvitationInWindowsBar() self.__notified.add(prbID) if not haveInvites: self.__notified.clear()
def __onInviteListModified(self, added, changed, deleted): showInvitationInWindowsBar() model = self._model() if model is None: return for inviteID in added: invite = self.prbInvites.getInvite(inviteID) if invite: model.addNotification(PrbInviteDecorator(invite)) for inviteID in deleted: model.removeNotification(NOTIFICATION_TYPE.INVITE, inviteID) for inviteID in changed: invite = self.prbInvites.getInvite(inviteID) if invite: model.updateNotification(NOTIFICATION_TYPE.INVITE, inviteID, invite, True)
def __onInviteListInited(self): if self.prbInvites.getUnreadCount() > 0: showInvitationInWindowsBar() self.__addInvites()
def loadPreArenaUnit(self, prbType, modeFlags=0): utils.showInvitationInWindowsBar() self.app.containerManager.clear() self.showUnitPreArenaWindow(prbType, modeFlags)
def blinkTaskbar(self, cmd): showInvitationInWindowsBar()