Just tried to unregister every event related to notifications:
Lua Code:
ZO_PreHook(CHAT_SYSTEM, "OnNumNotificationsChanged", function(self, totalNumNotifications)
error("test")
end)
local events = {
"EVENT_INCOMING_FRIEND_INVITE_ADDED",
"EVENT_INCOMING_FRIEND_INVITE_REMOVED",
"EVENT_INCOMING_FRIEND_INVITE_NOTE_UPDATED",
"EVENT_GUILD_INVITES_INITIALIZED",
"EVENT_GUILD_INVITE_ADDED",
"EVENT_GUILD_INVITE_REMOVED",
"EVENT_CAMPAIGN_QUEUE_JOINED",
"EVENT_CAMPAIGN_QUEUE_LEFT",
"EVENT_CAMPAIGN_QUEUE_STATE_CHANGED",
"EVENT_RESURRECT_REQUEST",
"EVENT_RESURRECT_REQUEST_REMOVED",
"EVENT_PLAYER_ALIVE",
"EVENT_GROUP_INVITE_RECEIVED",
"EVENT_GROUP_INVITE_REMOVED",
"EVENT_TRADE_INVITE_CONSIDERING",
"EVENT_TRADE_INVITE_REMOVED",
"EVENT_QUEST_SHARED",
"EVENT_QUEST_SHARE_REMOVED",
"EVENT_PLEDGE_OF_MARA_OFFER",
"EVENT_PLEDGE_OF_MARA_OFFER_REMOVED",
"EVENT_AGENT_CHAT_REQUESTED",
"EVENT_AGENT_CHAT_ACCEPTED",
"EVENT_AGENT_CHAT_DECLINED",
"EVENT_RAID_SCORE_NOTIFICATION_ADDED",
"EVENT_RAID_SCORE_NOTIFICATION_REMOVED",
}
local function ReassignEvent(name)
d("unregister " .. name .. ": " .. tostring(EVENT_MANAGER:UnregisterForEvent(NOTIFICATIONS.eventNamespace, _G[name])))
EVENT_MANAGER:RegisterForEvent("test", _G[name], function() d(name) end)
end
zo_callLater(function()
d(NOTIFICATIONS.eventNamespace)
for _, name in ipairs(events) do
ReassignEvent(name)
end
end, 1000)
The messages that were showing up when I revived obviously were caused by EVENT_PLAYER_ALIVE.
When I join a campaign queue I get:
Code:
EVENT_CAMPAIGN_QUEUE_JOINED
user:/AddOns/test/test.lua:130: test
stack traceback:
[C]: in function 'error'
user:/AddOns/test/test.lua:130: in function 'hookFunction'
EsoUI/Libraries/Utility/ZO_Hook.lua:19: in function 'OnNumNotificationsChanged'
EsoUI/Ingame/Contacts/Notifications_Common.lua:705: in function 'ZO_NotificationManager:BuildNotificationList'
EsoUI/Ingame/Contacts/Notifications_Common.lua:678: in function 'ZO_NotificationManager:RefreshNotificationList'
EsoUI/Ingame/Contacts/Notifications_Common.lua:58: in function 'ZO_NotificationProvider:PushUpdateToNotificationManager'
EsoUI/Ingame/Contacts/Notifications_Common.lua:34: in function '(anonymous)'
EVENT_CAMPAIGN_QUEUE_STATE_CHANGED
user:/AddOns/test/test.lua:130: test
stack traceback:
[C]: in function 'error'
user:/AddOns/test/test.lua:130: in function 'hookFunction'
EsoUI/Libraries/Utility/ZO_Hook.lua:19: in function 'OnNumNotificationsChanged'
EsoUI/Ingame/Contacts/Notifications_Common.lua:705: in function 'ZO_NotificationManager:BuildNotificationList'
EsoUI/Ingame/Contacts/Notifications_Common.lua:678: in function 'ZO_NotificationManager:RefreshNotificationList'
EsoUI/Ingame/Contacts/Notifications_Common.lua:58: in function 'ZO_NotificationProvider:PushUpdateToNotificationManager'
EsoUI/Ingame/Contacts/Notifications_Common.lua:34: in function '(anonymous)'
EVENT_CAMPAIGN_QUEUE_LEFT
user:/AddOns/test/test.lua:130: test
stack traceback:
[C]: in function 'error'
user:/AddOns/test/test.lua:130: in function 'hookFunction'
EsoUI/Libraries/Utility/ZO_Hook.lua:19: in function 'OnNumNotificationsChanged'
EsoUI/Ingame/Contacts/Notifications_Common.lua:705: in function 'ZO_NotificationManager:BuildNotificationList'
EsoUI/Ingame/Contacts/Notifications_Common.lua:678: in function 'ZO_NotificationManager:RefreshNotificationList'
EsoUI/Ingame/Contacts/Notifications_Common.lua:58: in function 'ZO_NotificationProvider:PushUpdateToNotificationManager'
EsoUI/Ingame/Contacts/Notifications_Common.lua:34: in function '(anonymous)'
I am not sure what I am missing here, but in my opinion this should work and not call the push function anymore...