| 9 | } |
| 10 | |
| 11 | void 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 | |
| 30 | Notification* NotificationManager::GetLatestNotification() |
| 31 | { |
no test coverage detected