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

Method HitTestAuthor

src/windows/MessageList.cpp:1189–1219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1187}
1188
1189void MessageList::HitTestAuthor(POINT pt, BOOL& hit)
1190{
1191 auto msg = FindMessageByPointAuthorRect(pt);
1192
1193 if (msg == m_messages.end() || msg->m_msg->m_snowflake != m_highlightedMessage)
1194 {
1195 if (m_highlightedMessage)
1196 {
1197 auto msg2 = FindMessage(m_highlightedMessage);
1198 if (msg2 != m_messages.end())
1199 {
1200 msg2->m_authorHighlighted = false;
1201 InvalidateRect(m_hwnd, &msg2->m_authorRect, FALSE);
1202 }
1203 }
1204
1205 m_highlightedMessage = 0;
1206
1207 if (msg == m_messages.end())
1208 return;
1209 }
1210
1211 hit = TRUE;
1212 if (m_highlightedMessage == msg->m_msg->m_snowflake)
1213 return;
1214
1215 m_highlightedMessage = msg->m_msg->m_snowflake;
1216 msg->m_authorHighlighted = true;
1217 InvalidateRect(m_hwnd, &msg->m_authorRect, FALSE);
1218 DbgPrintW("Hand! Profile ID: %lld Message ID: %lld", msg->m_msg->m_author_snowflake, msg->m_msg->m_snowflake);
1219}
1220
1221void MessageList::HitTestAttachments(POINT pt, BOOL& hit)
1222{

Callers 1

WndProcMethod · 0.80

Calls 2

DbgPrintWFunction · 0.85
endMethod · 0.45

Tested by

no test coverage detected