//
// ThreadOptionsPopup::threadUpdateFinished from 0x10094ae00 to 0x10094b324 (1316 bytes)
//
// 2 xrefs:
// > sub_10094B3A0 @ 0x10094b3ac
// > ??> @ 0x100bc66f0
//
// 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 12:38:35 +0000
//
__int64 __fastcall ThreadOptionsPopup::threadUpdateFinished(__int64 a1, __int64 a2, unsigned int a3)
{
__int64 result; // rax
__int64 v6; // rax
const char *v7; // rdx
const char *v8; // r15
bool v9; // zf
__int64 v10; // rdi
__int64 v11; // r14
size_t v12; // rax
size_t v13; // r12
char *v14; // r13
__int64 v15; // rdi
__int64 v16; // r14
const char *v17; // rsi
__int64 v18; // r15
char *v19; // rax
size_t v20; // r14
char *v21; // rax
__int64 v22; // rax
__int64 v23; // rcx
__int64 v24; // rdx
_QWORD *v25; // r14
__int64 v26; // rdi
_QWORD *v27; // rdi
_DWORD *v28; // rax
__int64 v29; // rax
const char *v30; // r12
__int64 v31; // r15
size_t v32; // rax
size_t v33; // r13
char *v34; // r15
size_t v35; // r14
char *v36; // rax
_DWORD *v37; // rax
__int128 v38; // [rsp+8h] [rbp-C8h] BYREF
void *v39; // [rsp+18h] [rbp-B8h]
__int128 v40; // [rsp+20h] [rbp-B0h] BYREF
void *__p; // [rsp+30h] [rbp-A0h]
__int128 v42; // [rsp+38h] [rbp-98h] BYREF
void *v43; // [rsp+48h] [rbp-88h]
_QWORD *v44; // [rsp+50h] [rbp-80h]
__int128 v45; // [rsp+58h] [rbp-78h] BYREF
void *v46; // [rsp+68h] [rbp-68h]
__int128 v47; // [rsp+70h] [rbp-60h] BYREF
void *v48; // [rsp+80h] [rbp-50h]
__int128 v49; // [rsp+88h] [rbp-48h] BYREF
void *v50; // [rsp+98h] [rbp-38h]
__int64 v51; // [rsp+A0h] [rbp-30h]
result = *(_QWORD *)(a1 + 1032);
if ( *(_DWORD *)(result + 56) == (_DWORD)a2 && *(_DWORD *)(a1 + 1048) == a3 )
{
*(_DWORD *)(a1 + 1048) = 0;
if ( a3 == 15 )
{
*(_BYTE *)(result + 274) ^= 1u;
v6 = cocos2d::CCDirector::sharedDirector();
v7 = "Conversation pinned";
v8 = "Conversation unpinned";
v9 = *(_BYTE *)(*(_QWORD *)(a1 + 1032) + 274LL) == 0;
LABEL_9:
if ( !v9 )
v8 = v7;
v11 = *(_QWORD *)(v6 + 272);
v12 = strlen(v8);
if ( v12 < 0xFFFFFFFFFFFFFFF8LL )
{
v13 = v12;
v51 = v11;
if ( v12 >= 0x17 )
{
v20 = 26;
if ( (v12 | 7) != 0x17 )
v20 = (v12 | 7) + 1;
v14 = (char *)operator new(v20);
v48 = v14;
*(_QWORD *)&v47 = v20 + 1;
*((_QWORD *)&v47 + 1) = v13;
}
else
{
LOBYTE(v47) = 2 * v12;
v14 = (char *)&v47 + 1;
if ( !v12 )
goto LABEL_28;
}
memcpy(v14, v8, v13);
LABEL_28:
v14[v13] = 0;
LOWORD(v38) = 0;
v21 = TextAlertPopup::create(&v47, 0x96u, &v38, 0.5, 0.60000002);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)v51 + 464LL))(v51, v21, 1000);
if ( (v38 & 1) != 0 )
{
operator delete(v39);
if ( (v47 & 1) == 0 )
{
LABEL_30:
if ( !*(_QWORD *)(a1 + 1040) )
goto LABEL_64;
LABEL_34:
v22 = GameLevelManager::sharedState();
v23 = *(_QWORD *)(a1 + 1040);
v24 = v23 + 672;
if ( !v23 )
v24 = 0;
*(_QWORD *)(v22 + 1264) = v24;
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1368LL))(a1, 0);
}
}
else if ( (v47 & 1) == 0 )
{
goto LABEL_30;
}
operator delete(v48);
if ( *(_QWORD *)(a1 + 1040) )
goto LABEL_34;
LABEL_64:
v37 = cocos2d::CCNotificationCenter::sharedNotificationCenter();
cocos2d::CCNotificationCenter::postNotification((__int64)v37, "ThreadsChangedNotification", 0);
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1368LL))(a1, 0);
}
LABEL_70:
sub_100003630();
}
if ( a3 == 10 )
{
*(_BYTE *)(result + 204) ^= 1u;
v6 = cocos2d::CCDirector::sharedDirector();
v7 = "Conversation muted";
v8 = "Conversation unmuted";
v9 = *(_BYTE *)(*(_QWORD *)(a1 + 1032) + 204LL) == 0;
goto LABEL_9;
}
if ( a3 - 101 <= 1 )
{
*(_BYTE *)(result + 272) = a3 == 101;
v15 = *(_QWORD *)(a1 + 1040);
if ( v15 )
sub_10092FFD0(v15);
v16 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector() + 272);
v17 = "Conversation unlocked";
if ( *(_BYTE *)(*(_QWORD *)(a1 + 1032) + 272LL) )
v17 = "Conversation locked";
v18 = 2 * (*(unsigned __int8 *)(*(_QWORD *)(a1 + 1032) + 272LL) ^ 1u);
LOBYTE(v45) = 2 * (2 * (*(_BYTE *)(*(_QWORD *)(a1 + 1032) + 272LL) ^ 1) + 19);
memcpy((char *)&v45 + 1, v17, v18 + 19);
*((_BYTE *)&v46 + v18 + 4) = 0;
LOWORD(v40) = 0;
v19 = TextAlertPopup::create(&v45, 0x96u, &v40, 0.5, 0.60000002);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)v16 + 464LL))(v16, v19, 1000);
if ( (v40 & 1) != 0 )
operator delete(__p);
if ( (v45 & 1) != 0 )
operator delete(v46);
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1368LL))(a1, 0);
}
if ( a3 <= 0x12 )
{
result = 264226;
if ( _bittest((const int *)&result, a3) )
{
v25 = *(_QWORD **)(a1 + 1040);
if ( v25 )
{
v26 = v25[115];
if ( v26 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v26 + 1368LL))(v26, 0);
v27 = (_QWORD *)v25[116];
if ( v27 )
{
v27[73] = 0;
(*(void (__fastcall **)(_QWORD *, _QWORD))(*v27 + 1160LL))(v27, 0);
}
v28 = cocos2d::CCNotificationCenter::sharedNotificationCenter();
cocos2d::CCNotificationCenter::postNotification((__int64)v28, "ThreadsChangedNotification", 0);
(*(void (__fastcall **)(_QWORD *, _QWORD))(*v25 + 1072LL))(v25, 0);
(*(void (__fastcall **)(_QWORD *, __int64))(*v25 + 528LL))(v25, 1);
*(_QWORD *)(a1 + 1040) = 0;
}
v29 = cocos2d::CCDirector::sharedDirector();
switch ( a3 )
{
case 5u:
v30 = "Left group chat";
break;
case 0xBu:
v30 = "Request cancelled";
break;
case 0x12u:
v30 = "Group chat removed";
break;
default:
v30 = "Messages cleared";
if ( !*(_DWORD *)(a1 + 1052) )
v30 = "Left conversation";
break;
}
v31 = *(_QWORD *)(v29 + 272);
v32 = strlen(v30);
if ( v32 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_70;
v33 = v32;
v51 = v31;
if ( v32 >= 0x17 )
{
v44 = v25;
v35 = 26;
if ( (v32 | 7) != 0x17 )
v35 = (v32 | 7) + 1;
v34 = (char *)operator new(v35);
v50 = v34;
*(_QWORD *)&v49 = v35 + 1;
v25 = v44;
*((_QWORD *)&v49 + 1) = v33;
}
else
{
LOBYTE(v49) = 2 * v32;
v34 = (char *)&v49 + 1;
if ( !v32 )
{
LABEL_61:
v34[v33] = 0;
LOWORD(v42) = 0;
v36 = TextAlertPopup::create(&v49, 0x96u, &v42, 0.5, 0.60000002);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)v51 + 464LL))(v51, v36, 1000);
if ( (v42 & 1) != 0 )
{
operator delete(v43);
if ( (v49 & 1) == 0 )
{
LABEL_63:
if ( v25 )
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1368LL))(a1, 0);
goto LABEL_64;
}
}
else if ( (v49 & 1) == 0 )
{
goto LABEL_63;
}
operator delete(v50);
if ( v25 )
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1368LL))(a1, 0);
goto LABEL_64;
}
}
memcpy(v34, v30, v33);
goto LABEL_61;
}
}
}
else
{
v10 = *(_QWORD *)(a1 + 1040);
if ( v10 )
return (*(__int64 (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v10 + 1456LL))(v10, a2, a3);
}
return result;
}