MCPcopy Create free account
hub / github.com/DiscordMessenger/dm / OnMessageCreate

Method OnMessageCreate

src/discord/NotificationManager.cpp:11–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9}
10
11void NotificationManager::OnMessageCreate(Snowflake guildID, Snowflake channelID, const Message& msg)
12{
13 if (!IsNotificationWorthy(guildID, channelID, msg))
14 return;
15
16 Notification notif;
17 notif.m_author = msg.m_author;
18 notif.m_contents = msg.m_message;
19 notif.m_avatarLnk = msg.m_avatar;
20 notif.m_sourceGuild = guildID;
21 notif.m_sourceChannel = channelID;
22 notif.m_sourceMessage = msg.m_snowflake;
23 notif.m_timeReceived = msg.m_dateTime;
24 notif.m_bIsReply = msg.m_type == MessageType::REPLY;
25
26 m_notifications.push_front(notif);
27 GetFrontend()->OnNotification();
28}
29
30Notification* NotificationManager::GetLatestNotification()
31{

Callers 2

WindowProcFunction · 0.80

Calls 2

GetFrontendFunction · 0.85
OnNotificationMethod · 0.45

Tested by

no test coverage detected