//
// MessagesProfilePage::loadMessagesFinished from 0x1001cd4a8 to 0x1001cd5ac (260 bytes)
//
// 2 xrefs:
// > sub_1001CD5AC @ 0x1001cd5b0
// > ??> @ 0x1007ba7b8
//
// 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 MessagesProfilePage::loadMessagesFinished(
MessagesProfilePage *a1,
cocos2d::CCArray *a2,
const char *a3)
{
cocos2d::ccArray *data; // x8
__int64 num; // x9
int v7; // w20
cocos2d::CCObject **arr; // x8
unsigned __int64 v9; // x9
GameLevelManager *v10; // x19
GJAccountManager *v11; // x0
GJUserScore *v12; // x0
if ( MessagesProfilePage::isCorrect(a1, a3) )
{
MessagesProfilePage::setupCommentsBrowser(a1, a2);
((void (__fastcall *)(LoadingCircle *, _QWORD))a1->m_loadingCircle->setVisible)(a1->m_loadingCircle, 0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))a1->m_errorLabel->setVisible)(a1->m_errorLabel, 0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))a1->m_refreshButton->setVisible)(a1->m_refreshButton, 1);
if ( a2 )
{
if ( !a1->m_sentMessages && (unsigned int)sub_10024A36C(a2) )
{
data = a2->data;
num = data->num;
if ( (_DWORD)num )
{
v7 = 0;
arr = data->arr;
v9 = (unsigned __int64)&arr[num - 1];
do
{
if ( !*arr )
break;
v7 += LOBYTE((*arr++)[7].m_uIndexInArray) ^ 1;
}
while ( (unsigned __int64)arr <= v9 );
}
else
{
v7 = 0;
}
v10 = GameLevelManager::sharedState();
v11 = GJAccountManager::sharedState();
v12 = GameLevelManager::userInfoForAccountID(v10, v11->m_accountID - v11->m_unkInt1);
if ( v12 )
{
if ( v12->m_newMsgCount < v7 )
v12->m_newMsgCount = v7;
}
}
}
}
}