//
// GameLevelManager::deleteFriendRequests from 0x1000a8770 to 0x1000a8a18 (680 bytes)
//
// 4 xrefs:
// > GameLevelManager::deleteSentFriendRequest @ 0x1000a876c
// > GJRequestCell::FLAlert_Clicked @ 0x100112308
// > FRequestProfilePage::deleteSelected @ 0x1001b7060
// > FriendRequestPopup::onRemove @ 0x1002d9b64
//
// 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::deleteFriendRequests(GameLevelManager *a1, int a2, cocos2d::CCArray *a3, bool a4)
{
_BOOL4 v4; // w22
cocos2d::CCArray *v5; // x20
__int64 v8; // x0
int v9; // w8
cocos2d::CCString *v10; // x0
char *CString; // x21
cocos2d::CCDictionary *m_friendReqAndUserBlocks; // x24
__int64 v13; // x0
__int64 v14; // x24
int v15; // w0
cocos2d::CCDictionary *v16; // x24
cocos2d::CCNode *v17; // x25
cocos2d::CCString *v18; // x0
const char *v19; // x0
cocos2d::CCString *v20; // x0
const char *v21; // x0
__int64 i; // x22
__int64 v23; // x25
cocos2d::CCString *v24; // x0
const char *v25; // x0
std::string *v26; // x1
void *__p[2]; // [xsp+30h] [xbp-A0h] BYREF
char v29; // [xsp+47h] [xbp-89h]
void *v30[2]; // [xsp+48h] [xbp-88h] BYREF
char v31; // [xsp+5Fh] [xbp-71h]
std::string v32; // [xsp+60h] [xbp-70h] BYREF
std::string v33; // [xsp+78h] [xbp-58h] BYREF
v4 = a4;
v5 = a3;
if ( a3 && (unsigned int)sub_10024A36C(a3) == 1 )
{
v8 = sub_10024A388(v5, 0);
v5 = nullptr;
a2 = *(_DWORD *)(v8 + 376);
}
if ( a2 <= 0 )
{
if ( !v5 )
goto LABEL_15;
v15 = sub_10024A36C(v5);
if ( !v15 )
return v15;
}
if ( v5 )
v9 = -1;
else
v9 = a2;
v10 = (cocos2d::CCString *)sub_100268F4C("delFriendReq_%i_%i", v9, v4);
CString = (char *)cocos2d::CCString::getCString(v10);
m_friendReqAndUserBlocks = a1->m_friendReqAndUserBlocks;
sub_100009900(&v33, CString);
v13 = cocos2d::CCDictionary::objectForKey_1(m_friendReqAndUserBlocks, &v33);
v14 = v13;
if ( (SHIBYTE(v33.__r_.__value_.__r.__words[2]) & 0x80000000) == 0 )
{
if ( !v13 )
goto LABEL_16;
LABEL_15:
LOBYTE(v15) = 0;
return v15;
}
operator delete(v33.__r_.__value_.__l.__data_);
if ( v14 )
goto LABEL_15;
LABEL_16:
v16 = a1->m_friendReqAndUserBlocks;
v17 = cocos2d::CCNode::create();
sub_100009900(&v33, CString);
cocos2d::CCDictionary::setObject_1(v16, v17, &v33);
if ( SHIBYTE(v33.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v33.__r_.__value_.__l.__data_);
GameLevelManager::getBasePostString(&v33);
v18 = (cocos2d::CCString *)sub_100268F4C("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, "7");
v19 = cocos2d::CCString::getCString(v18);
v20 = (cocos2d::CCString *)sub_100268F4C("&targetAccountID=%i&isSender=%i&secret=%s", a2, v4, v19);
v21 = cocos2d::CCString::getCString(v20);
std::string::append(&v33, v21);
if ( v5 )
{
std::string::append(&v33, "&accounts=");
for ( i = 0; (unsigned int)i < (unsigned int)sub_10024A36C(v5); i = (unsigned int)(i + 1) )
{
v23 = sub_10024A388(v5, i);
if ( (_DWORD)i )
std::string::append(&v33, ",");
v24 = (cocos2d::CCString *)sub_100268F4C("%i", *(_DWORD *)(v23 + 376));
v25 = cocos2d::CCString::getCString(v24);
std::string::append(&v33, v25);
}
}
sub_100009900(&v32, "https://www.boomlings.com/database/deleteGJFriendRequests20.php");
if ( (v33.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v26 = &v33;
else
v26 = (std::string *)v33.__r_.__value_.__r.__words[0];
sub_100009900(v30, (char *)v26);
sub_100009900(__p, CString);
GameLevelManager::ProcessHttpRequest(a1, &v32, (char *)v30, (const std::string::value_type *)__p, 30);
if ( v29 < 0 )
operator delete(__p[0]);
if ( v31 < 0 )
operator delete(v30[0]);
if ( SHIBYTE(v32.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v32.__r_.__value_.__l.__data_);
if ( SHIBYTE(v33.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v33.__r_.__value_.__l.__data_);
LOBYTE(v15) = 1;
return v15;
}