//
// MessagesProfilePage::loadMessagesFinished from 0x10022f650 to 0x10022f75e (270 bytes)
//
// 2 xrefs:
// > sub_10022F760 @ 0x10022f76c
// > ??> @ 0x1008e1770
//
// 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; // rax
__int64 num; // rcx
cocos2d::CCObject **arr; // rax
unsigned __int64 v6; // rcx
int v7; // r14d
GameLevelManager *v8; // rbx
GJAccountManager *v9; // rax
GJUserScore *v10; // rax
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_100720070(a2) )
{
data = a2->data;
num = data->num;
if ( data->num )
{
arr = data->arr;
v6 = (unsigned __int64)&arr[num - 1];
v7 = 0;
do
{
if ( !*arr )
break;
v7 += LOBYTE((*arr++)[7].m_uIndexInArray) ^ 1;
}
while ( (unsigned __int64)arr <= v6 );
}
else
{
v7 = 0;
}
v8 = GameLevelManager::sharedState();
v9 = GJAccountManager::sharedState();
v10 = GameLevelManager::userInfoForAccountID(v8, v9->m_accountID - v9->m_unkInt1);
if ( v10 )
{
if ( v10->m_newMsgCount < v7 )
v10->m_newMsgCount = v7;
}
}
}
}
}