def checkUnreadNotifications(self):
     notifyService = sm.services.get("notificationSvc", None)
     if not notifyService:
         return
     
     if not eve.session.charid:
         return
     
     unreadNotifications = notifyService.GetFormattedUnreadNotifications() 
     
     if len(unreadNotifications):
         for n in unreadNotifications:
             fireEvent("UnreadNotification", text=strip_tags(str(n.body)))
     
     notifyIDs = [n.notificationID for n in unreadNotifications]
     notifyService.MarkAsRead(notifyIDs)
     notifyService.UpdateCacheAfterMarkingRead(notifyIDs)
 def checkUnreadNotifications(self):
     notifyService = sm.services.get("notificationSvc", None)
     if not notifyService:
         return
     
     if not eve.session.charid:
         return
     
     towermails = [n for n in notifyService.GetFormattedUnreadNotifications() 
                   if n.typeID == const.notificationTypeTowerAlertMsg]
     
     if len(towermails):
         for n in towermails:
             formatted = self.formatTowermail(n)
             fireEvent("NewTowermail", text=formatted)
     
     notifyIDs = [n.notificationID for n in towermails]
     notifyService.MarkAsRead(notifyIDs)
     notifyService.UpdateCacheAfterMarkingRead(notifyIDs)
Beispiel #3
0
    def checkUnreadNotifications(self):
        notifyService = sm.services.get("notificationSvc", None)
        if not notifyService:
            return

        if not eve.session.charid:
            return

        towermails = [
            n for n in notifyService.GetFormattedUnreadNotifications()
            if n.typeID == const.notificationTypeTowerAlertMsg
        ]

        if len(towermails):
            for n in towermails:
                formatted = self.formatTowermail(n)
                fireEvent("NewTowermail", text=formatted)

        notifyIDs = [n.notificationID for n in towermails]
        notifyService.MarkAsRead(notifyIDs)
        notifyService.UpdateCacheAfterMarkingRead(notifyIDs)