//
// GameLevelManager::deleteUserMessages from 0x1000a57e4 to 0x1000a5ab4 (720 bytes)
//
// 3 xrefs:
// > GJMessageCell::FLAlert_Clicked @ 0x100112998
// > MessagesProfilePage::deleteSelected @ 0x1001ccf1c
// > GJMessagePopup::FLAlert_Clicked @ 0x1002dbb08
//
// 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
//
bool __fastcall GameLevelManager::deleteUserMessages(
GameLevelManager *a1,
GJUserMessage *a2,
cocos2d::CCArray *a3,
bool a4)
{
_BOOL4 v4; // w22
int m_messageID; // w8
cocos2d::CCString *v9; // x0
const char *CString; // x0
bool v11; // w19
cocos2d::CCDictionary *m_friendReqAndUserBlocks; // x23
cocos2d::CCNode *v13; // x0
cocos2d::CCString *v14; // x0
const char *v15; // x0
cocos2d::CCString *v16; // x0
const char *v17; // x0
cocos2d::CCString *v18; // x0
const char *v19; // x0
std::string *v20; // x1
__int64 i; // x21
__int64 v22; // x24
cocos2d::CCString *v23; // x0
const char *v24; // x0
std::string __p; // [xsp+30h] [xbp-B0h] BYREF
void *v27[2]; // [xsp+50h] [xbp-90h] BYREF
char v28; // [xsp+67h] [xbp-79h]
std::string v29; // [xsp+68h] [xbp-78h] BYREF
std::string v30; // [xsp+80h] [xbp-60h] BYREF
std::string v31; // [xsp+98h] [xbp-48h] BYREF
v4 = a4;
sub_100009900(&v31, "");
if ( a3 && (unsigned int)sub_10024A36C(a3) == 1 )
{
a2 = (GJUserMessage *)sub_10024A388(a3, 0);
a3 = nullptr;
}
if ( a2 )
{
m_messageID = a2->m_messageID;
}
else
{
if ( !a3 )
{
LABEL_9:
v11 = 0;
goto LABEL_34;
}
m_messageID = -1;
}
v9 = (cocos2d::CCString *)sub_100268F4C("delMsg_%i_%i", m_messageID, v4);
CString = cocos2d::CCString::getCString(v9);
std::string::assign(&v31, CString);
if ( cocos2d::CCDictionary::objectForKey_1(a1->m_friendReqAndUserBlocks, &v31) )
goto LABEL_9;
m_friendReqAndUserBlocks = a1->m_friendReqAndUserBlocks;
v13 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject_1(m_friendReqAndUserBlocks, v13, &v31);
GameLevelManager::getBasePostString(&v30);
v14 = (cocos2d::CCString *)sub_100268F4C("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, "7");
v15 = cocos2d::CCString::getCString(v14);
v16 = (cocos2d::CCString *)sub_100268F4C("&secret=%s", v15);
v17 = cocos2d::CCString::getCString(v16);
std::string::append(&v30, v17);
if ( v4 )
std::string::append(&v30, "&isSender=1");
if ( a2 )
{
std::string::append(&v30, "&messageID=");
v18 = (cocos2d::CCString *)sub_100268F4C("%i", a2->m_messageID);
v19 = cocos2d::CCString::getCString(v18);
std::string::append(&v30, v19);
}
else
{
std::string::append(&v30, "&messages=");
for ( i = 0; (unsigned int)i < (unsigned int)sub_10024A36C(a3); i = (unsigned int)(i + 1) )
{
v22 = sub_10024A388(a3, i);
if ( (_DWORD)i )
std::string::append(&v30, ",");
v23 = (cocos2d::CCString *)sub_100268F4C("%i", *(_DWORD *)(v22 + 316));
v24 = cocos2d::CCString::getCString(v23);
std::string::append(&v30, v24);
}
}
sub_100009900(&v29, "https://www.boomlings.com/database/deleteGJMessages20.php");
if ( (v30.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v20 = &v30;
else
v20 = (std::string *)v30.__r_.__value_.__r.__words[0];
sub_100009900(v27, (char *)v20);
if ( SHIBYTE(v31.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__p, v31.__r_.__value_.__l.__data_, v31.__r_.__value_.__l.__size_);
else
__p = v31;
GameLevelManager::ProcessHttpRequest(a1, &v29, (char *)v27, (const std::string::value_type *)&__p, 39);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( v28 < 0 )
operator delete(v27[0]);
if ( SHIBYTE(v29.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v29.__r_.__value_.__l.__data_);
if ( SHIBYTE(v30.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v30.__r_.__value_.__l.__data_);
v11 = 1;
LABEL_34:
if ( SHIBYTE(v31.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v31.__r_.__value_.__l.__data_);
return v11;
}