//
// MessagesProfilePage::onClose from 0x10022e400 to 0x10022e520 (288 bytes)
//
// 3 xrefs:
// > MessagesProfilePage::keyBackClicked @ 0x10022f355
// > sub_10022F360 @ 0x10022f36c
// > MessagesProfilePage::init @ 0x10022dc8f
//
// 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::onClose(MessagesProfilePage *a1, cocos2d::CCObject *m_listLayer)
{
cocos2d::CCDirector *v2; // rax
cocos2d::CCTouchDispatcher *v3; // rax
cocos2d::CCDirector *v4; // rax
cocos2d::CCTouchDispatcher *v5; // rax
GameLevelManager *v6; // rax
cocos2d::CCArray *StoredOnlineLevels; // rax
cocos2d::ccArray *data; // rax
__int64 num; // rcx
unsigned __int64 arr; // rax
unsigned __int64 v11; // rcx
_BYTE *v12; // rax
GJAccountManager *v13; // rax
if ( a1->m_listLayer )
{
v2 = cocos2d::CCDirector::sharedDirector();
v3 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(cocos2d::CCDirector *, cocos2d::CCObject *))v2->getTouchDispatcher)(
v2,
m_listLayer);
m_listLayer = a1->m_listLayer;
cocos2d::CCTouchDispatcher::unregisterForcePrio(v3, m_listLayer);
}
v4 = cocos2d::CCDirector::sharedDirector();
v5 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(cocos2d::CCDirector *, cocos2d::CCObject *))v4->getTouchDispatcher)(
v4,
m_listLayer);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v5, a1);
v6 = GameLevelManager::sharedState();
if ( (a1->m_messageKey.m_data.m_short.sizex2 & 1) != 0 )
{
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v6, a1->m_messageKey.m_data.m_long.longStorage);
if ( !StoredOnlineLevels )
goto LABEL_11;
}
else
{
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(
v6,
a1->m_messageKey.m_data.m_short.shortStorage.__elems_);
if ( !StoredOnlineLevels )
goto LABEL_11;
}
data = StoredOnlineLevels->data;
num = data->num;
if ( data->num )
{
arr = (unsigned __int64)data->arr;
v11 = arr + 8 * num - 8;
do
{
if ( !*(_QWORD *)arr )
break;
*(_BYTE *)(*(_QWORD *)arr + 426LL) = 0;
arr += 8LL;
}
while ( arr <= v11 );
}
LABEL_11:
if ( a1->m_sentMessages )
{
v12 = MessagesProfilePage::create(0);
}
else
{
v13 = GJAccountManager::sharedState();
v12 = ProfilePage::create(v13->m_accountID - v13->m_unkInt1, 1);
v12[588] = 1;
}
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)v12 + 1288LL))(v12);
((void (__fastcall *)(MessagesProfilePage *, _QWORD))a1->setKeypadEnabled)(a1, 0);
((void (__fastcall *)(MessagesProfilePage *, __int64))a1->removeFromParentAndCleanup)(a1, 1);
}