//
// GJMessageCell::markAsRead from 0x100112810 to 0x10011289c (140 bytes)
//
// 2 xrefs:
// > GJMessageCell::onViewMessage @ 0x1001126a8
// > GJMessageCell::FLAlert_Clicked @ 0x100112984
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJMessageCell::markAsRead(GJMessageCell *a1)
{
GJUserMessage *m_message; // x8
__int64 v2; // x0
GameLevelManager *v3; // x19
GJAccountManager *v4; // x0
GJUserScore *v5; // x0
int m_newMsgCount; // w8
m_message = a1->m_message;
if ( !m_message->m_read )
{
m_message->m_read = 1;
v2 = ((__int64 (__fastcall *)(cocos2d::CCLayer *, __int64))a1->m_mainLayer->getChildByTag)(a1->m_mainLayer, 100);
if ( v2 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v2 + 328LL))(v2, 0);
v3 = GameLevelManager::sharedState();
v4 = GJAccountManager::sharedState();
v5 = GameLevelManager::userInfoForAccountID(v3, v4->m_accountID - v4->m_unkInt1);
if ( v5 )
{
m_newMsgCount = v5->m_newMsgCount;
if ( m_newMsgCount <= 1 )
m_newMsgCount = 1;
v5->m_newMsgCount = m_newMsgCount - 1;
}
}
}