//
// GameLevelManager::deleteUserMessages from 0x4b76c0 to 0x4b78fc (572 bytes)
//
// 3 xrefs:
// > GJMessageCell::FLAlert_Clicked @ 0x4281e6
// > GJMessagePopup::FLAlert_Clicked @ 0x5d9e24
// > MessagesProfilePage::deleteSelected @ 0x5efcfe
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:50:10 +0000
//
int __fastcall GameLevelManager::deleteUserMessages(
GameLevelManager *this,
GJUserMessage *a2,
cocos2d::CCArray *a3,
const char *a4)
{
GameLevelManager *v8; // r0
int v9; // r1
char *v10; // r0
int v11; // r4
int v12; // r4
cocos2d::CCObject *v13; // r0
cocos2d::CCString *v14; // r0
const char *CString; // r0
cocos2d::CCString *v16; // r0
char *v17; // r0
cocos2d::CCString *v18; // r0
char *v19; // r0
unsigned int v20; // r8
int v21; // r11
cocos2d::CCString *v22; // r0
char *v23; // r0
size_t v24; // r0
int v26[3]; // [sp+18h] [bp-44h] BYREF
char *v27[3]; // [sp+24h] [bp-38h] BYREF
int v28[3]; // [sp+30h] [bp-2Ch] BYREF
int v29[3]; // [sp+3Ch] [bp-20h] BYREF
int v30[3]; // [sp+48h] [bp-14h] BYREF
memset(v26, 0, sizeof(v26));
std::string::__init(v26, &unk_B6B226, 0);
if ( !a3 )
{
if ( !a2 )
goto LABEL_9;
goto LABEL_5;
}
if ( cocos2d::CCArray::count(a3) == 1 )
{
a2 = (GJUserMessage *)cocos2d::CCArray::objectAtIndex(a3, 0);
if ( !a2 )
{
LABEL_9:
v11 = 0;
goto LABEL_25;
}
a3 = nullptr;
goto LABEL_5;
}
if ( a2 )
{
LABEL_5:
v8 = this;
v9 = *((_DWORD *)a2 + 66);
goto LABEL_8;
}
v8 = this;
v9 = -1;
LABEL_8:
v10 = (char *)GameLevelManager::getDeleteMessageKey(v8, (const char *)v9, (int)a4);
std::string::assign(v26, v10);
if ( cocos2d::CCDictionary::objectForKey(*((_DWORD *)this + 187), v26) )
goto LABEL_9;
v12 = *((_DWORD *)this + 187);
v13 = (cocos2d::CCObject *)cocos2d::CCNode::create(nullptr);
cocos2d::CCDictionary::setObject(v12, v13);
GameLevelManager::getBasePostString((GameLevelManager *)v27);
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&a1i2r3e45s789g[9]);
CString = (const char *)cocos2d::CCString::getCString(v14);
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"&secret=%s", CString);
v17 = (char *)cocos2d::CCString::getCString(v16);
std::string::append(v27, v17);
if ( a4 )
std::string::append(v27, "&isSender=1");
if ( a2 )
{
std::string::append(v27, "&messageID=");
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", *((const char **)a2 + 66));
v19 = (char *)cocos2d::CCString::getCString(v18);
std::string::append(v27, v19);
}
else
{
std::string::append(v27, "&messages=");
v20 = 0;
a4 = ",";
while ( v20 < cocos2d::CCArray::count(a3) )
{
v21 = cocos2d::CCArray::objectAtIndex(a3, v20);
if ( v20 )
std::string::append(v27, ",");
v22 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
*(const char **)(v21 + 264));
v23 = (char *)cocos2d::CCString::getCString(v22);
std::string::append(v27, v23);
++v20;
}
}
memset(v28, 0, sizeof(v28));
std::string::__init(v28, "https://www.boomlings.com/database/deleteGJMessages20.php", 0x39u);
if ( ((int)v27[0] & 1) == 0 )
a4 = (char *)v27 + 1;
v29[0] = 0;
if ( ((int)v27[0] & 1) != 0 )
a4 = v27[2];
v29[1] = 0;
v29[2] = 0;
v24 = strlen(a4);
std::string::__init(v29, a4, v24);
std::string::basic_string(v30, (int)v26);
GameLevelManager::ProcessHttpRequest(this, v28, (int)v29, (int)v30, 45);
std::string::~string((int)v30);
std::string::~string((int)v29);
std::string::~string((int)v28);
std::string::~string((int)v27);
v11 = 1;
LABEL_25:
std::string::~string((int)v26);
return v11;
}