//
// ThreadOptionsPopup::threadUpdateFinished from 0xc7802c to 0xc784b4 (1160 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'ThreadOptionsPopup::threadUpdateFinished @ 0xc784bc
// > ??> @ 0x79528
// > ??> @ 0x14f0528
//
// This function is hookable on this platform (idp: arm, 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 13:05:34 +0000
//
__int64 __fastcall ThreadOptionsPopup::threadUpdateFinished(ThreadOptionsPopup *this, int a2, const char *a3)
{
__int64 v4; // x0
__int64 v5; // x0
int v7; // w21
__int64 v8; // x23
__int64 v9; // x24
void (__fastcall *v10)(__int64, __int64, __int64); // x25
const char *v11; // x1
size_t v12; // x0
__int64 v13; // x0
GameLevelManager *v14; // x0
cocos2d::CCNotificationCenter *v15; // x0
__int64 v16; // x23
const char *v17; // x1
void (__fastcall *v18)(__int64, __int64, __int64); // x24
size_t v19; // x0
__int64 v20; // x0
__int64 v21; // x0
__int64 v22; // x2
__int64 v23; // x1
_BOOL8 v24; // x1
ThreadViewPopup *refreshed; // x0
__int64 v26; // x23
void (__fastcall *v27)(__int64, __int64, __int64); // x24
const char *v28; // x1
size_t v29; // x0
__int64 v30; // x0
char *v31; // [xsp+58h] [xbp+58h]
char *v32; // [xsp+58h] [xbp+58h]
char *v33; // [xsp+58h] [xbp+58h]
cocos2d::CCNotificationCenter *v34; // [xsp+68h] [xbp+68h] BYREF
__int64 v35; // [xsp+70h] [xbp+70h]
void *v36; // [xsp+78h] [xbp+78h]
__int64 v37; // [xsp+80h] [xbp+80h] BYREF
__int64 v38; // [xsp+88h] [xbp+88h]
void *v39; // [xsp+90h] [xbp+90h]
v4 = *((_QWORD *)this + 129);
if ( *(_DWORD *)(v4 + 56) != a2 || (v7 = *((_DWORD *)this + 262), v7 != (_DWORD)a3) )
{
v5 = *((_QWORD *)this + 130);
if ( v5 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 1456LL))(v5);
return _stack_chk_guard;
}
*((_DWORD *)this + 262) = 0;
if ( v7 == 15 )
{
*(_BYTE *)(v4 + 274) ^= 1u;
v16 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v4) + 272);
if ( *(_BYTE *)(*((_QWORD *)this + 129) + 274LL) )
v17 = "Conversation pinned";
else
v17 = "Conversation unpinned";
LABEL_28:
v32 = (char *)v17;
v18 = *(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v16 + 464LL);
v34 = nullptr;
v35 = 0;
v36 = nullptr;
v19 = strlen(v17);
std::string::__init((__int64 *)&v34, v32, v19);
v37 = 0;
v38 = 0;
v39 = nullptr;
std::string::__init(&v37, &byte_11B8890, 0);
v20 = TextAlertPopup::create((char *)&v34, 150, (char *)&v37, 0.5, 0.6);
v18(v16, v20, 1000);
if ( (v37 & 1) != 0 )
operator delete(v39);
if ( ((unsigned __int8)v34 & 1) != 0 )
operator delete(v36);
v14 = *((GameLevelManager **)this + 130);
if ( v14 )
{
v21 = GameLevelManager::sharedState(v14);
v22 = *((_QWORD *)this + 130);
v23 = v22 + 672;
if ( !v22 )
v23 = 0;
*(_QWORD *)(v21 + 1264) = v23;
goto LABEL_36;
}
LABEL_25:
v15 = (cocos2d::CCNotificationCenter *)cocos2d::CCNotificationCenter::sharedNotificationCenter(v14);
cocos2d::CCNotificationCenter::postNotification(v15, "ThreadsChangedNotification", nullptr);
LABEL_36:
(*(void (__fastcall **)(ThreadOptionsPopup *, _QWORD))(*(_QWORD *)this + 1368LL))(this, 0);
return _stack_chk_guard;
}
if ( v7 == 10 )
{
*(_BYTE *)(v4 + 204) ^= 1u;
v16 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v4) + 272);
if ( *(_BYTE *)(*((_QWORD *)this + 129) + 204LL) )
v17 = "Conversation muted";
else
v17 = "Conversation unmuted";
goto LABEL_28;
}
if ( (unsigned int)(v7 - 101) <= 1 )
{
v24 = v7 == 101;
*(_BYTE *)(v4 + 272) = v24;
refreshed = *((ThreadViewPopup **)this + 130);
if ( refreshed )
refreshed = (ThreadViewPopup *)ThreadViewPopup::refreshLockNotice(refreshed, v24, a3);
v26 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector(refreshed) + 272);
v27 = *(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v26 + 464LL);
if ( *(_BYTE *)(*((_QWORD *)this + 129) + 272LL) )
v28 = "Conversation locked";
else
v28 = "Conversation unlocked";
v33 = (char *)v28;
v34 = nullptr;
v35 = 0;
v36 = nullptr;
v29 = strlen(v28);
std::string::__init((__int64 *)&v34, v33, v29);
v37 = 0;
v38 = 0;
v39 = nullptr;
std::string::__init(&v37, &byte_11B8890, 0);
v30 = TextAlertPopup::create((char *)&v34, 150, (char *)&v37, 0.5, 0.6);
v27(v26, v30, 1000);
if ( (v37 & 1) != 0 )
operator delete(v39);
if ( ((unsigned __int8)v34 & 1) != 0 )
operator delete(v36);
goto LABEL_36;
}
if ( v7 == 1 || v7 == 5 || v7 == 11 || v7 == 18 )
{
v8 = *((_QWORD *)this + 130);
if ( v8 )
{
v4 = ThreadViewPopup::onClose(*((ThreadViewPopup **)this + 130), nullptr);
*((_QWORD *)this + 130) = 0;
}
v9 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v4) + 272);
v10 = *(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v9 + 464LL);
switch ( v7 )
{
case 11:
v11 = "Request cancelled";
break;
case 5:
v11 = "Left group chat";
break;
case 18:
v11 = "Group chat removed";
break;
default:
if ( *((_DWORD *)this + 263) )
v11 = "Messages cleared";
else
v11 = "Left conversation";
break;
}
v31 = (char *)v11;
v34 = nullptr;
v35 = 0;
v36 = nullptr;
v12 = strlen(v11);
std::string::__init((__int64 *)&v34, v31, v12);
v37 = 0;
v38 = 0;
v39 = nullptr;
std::string::__init(&v37, &byte_11B8890, 0);
v13 = TextAlertPopup::create((char *)&v34, 150, (char *)&v37, 0.5, 0.6);
v10(v9, v13, 1000);
if ( (v37 & 1) != 0 )
operator delete(v39);
v14 = (GameLevelManager *)(unsigned __int8)v34;
if ( ((unsigned __int8)v34 & 1) != 0 )
operator delete(v36);
if ( v8 )
goto LABEL_36;
goto LABEL_25;
}
return _stack_chk_guard;
}