refresh applications when receiving a message with unknown appid

This commit is contained in:
dries.k
2021-09-27 22:28:44 +02:00
parent e7d7ed6cf3
commit 1cfa44302e

View File

@@ -250,7 +250,13 @@ class MainWindow(QtWidgets.QMainWindow):
def new_message_callback(self, message: gotify.GotifyMessageModel): def new_message_callback(self, message: gotify.GotifyMessageModel):
# Show a notification # Show a notification
application_item = self.application_model.itemFromId(message.appid) if not (application_item := self.application_model.itemFromId(message.appid)):
logger.error(
f"MainWindow.new_message_callback: App id {message.appid} could not be found. Refreshing applications."
)
self.refresh_applications()
return
if not self.isActiveWindow() and message.priority >= settings.value( if not self.isActiveWindow() and message.priority >= settings.value(
"tray/notifications/priority", type=int "tray/notifications/priority", type=int
): ):