//
// MessageThreadsPage::onRefresh from 0x1400d8170 to 0x1400d8325 (437 bytes)
//
// 2 xrefs:
// > MessageThreadsPage::init @ 0x1400d5673
// > ??> @ 0x140914774
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:26:27 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall MessageThreadsPage::onRefresh(__int64 a1)
{
__int64 v2; // rcx
__int64 v3; // rcx
__int64 *v4; // rdi
__int64 v5; // rbx
__int64 v6; // rdx
__int64 v7; // r8
__int64 v8; // rax
__int64 v9; // rcx
int v10; // edx
__int128 v11; // [rsp+30h] [rbp-48h] BYREF
__int64 v12; // [rsp+40h] [rbp-38h]
__int64 v13; // [rsp+48h] [rbp-30h]
__int128 v14; // [rsp+50h] [rbp-28h] BYREF
__int64 v15; // [rsp+60h] [rbp-18h]
__int64 v16; // [rsp+68h] [rbp-10h]
void *v17; // [rsp+90h] [rbp+18h]
void *v18; // [rsp+90h] [rbp+18h]
v2 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v17 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v17);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v2 = *(_QWORD *)&qword_14090BFB0;
}
if ( (unsigned int)GameLevelManager::getTimeLeft(v2, "threadInboxUpdate") - 1 > 4 )
{
v9 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v18 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v18);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v9 = *(_QWORD *)&qword_14090BFB0;
}
GameLevelManager::makeTimeStamp(v9, "threadInboxUpdate");
if ( (unsigned __int8)MessageThreadsPage::syncSearchFromBox((_QWORD *)a1) )
v10 = 0;
else
v10 = *(_DWORD *)(a1 + 840);
MessageThreadsPage::loadPage(a1, v10, 0);
}
else
{
v4 = *(__int64 **)(cocos2d::CCDirector::sharedDirector(v3) + 272);
v14 = 0;
v15 = 0;
v16 = 15;
LOBYTE(v14) = 0;
v11 = 0;
*(_QWORD *)&v11 = sub_14003D460(0x20u);
v12 = 18;
v13 = 31;
strcpy((char *)v11, "Already up to date");
v5 = *v4;
v8 = TextAlertPopup::create(&v11, v6, v7, 150, &v14);
(*(void (__fastcall **)(__int64 *, __int64, __int64))(v5 + 456))(v4, v8, 1000);
}
}