SmartFoxServer 2X C++ API
Sfs2X::Requests::Buddylist::RemoveBuddyRequest Class Reference

Remove a new Buddy fron the current Buddy List More...

#include <RemoveBuddyRequest.h>

Inherits Sfs2X::Requests::BaseRequest.

Public Member Functions

 RemoveBuddyRequest (string buddyName)
 Constructor More...
 

Detailed Description

Remove a new Buddy fron the current Buddy List

Constructor & Destructor Documentation

◆ RemoveBuddyRequest()

Sfs2X::Requests::Buddylist::RemoveBuddyRequest::RemoveBuddyRequest ( string  buddyName)

Constructor

Parameters
buddyNamethe name of the buddy to remove
ptrSmartFox->AddEventListener(SFSEvent::BUDDY_REMOVE, boost::shared_ptr<EventListenerDelegate> (EventListenerDelegate(CMyClass::OnBuddyRemoved, (unsigned long long)this));
ptrSmartFox->AddEventListener(SFSEvent::BUDDY_ERROR, boost::shared_ptr<EventListenerDelegate> (EventListenerDelegate(CMyClass::OnBuddyError, (unsigned long long)this));
// Remove a buddy from the buddy list
boost::shared_ptr<IRequest> request (new RemoveBuddyRequest("Gonzo The Great"));
ptrSmartFox->Send(request);
static void OnBuddyRemoved(unsigned long long ptrContext, boost::shared_ptr<BaseEvent> ptrEvent);
static void OnBuddyError(unsigned long long ptrContext, boost::shared_ptr<BaseEvent> ptrEvent);
void CMyClass::OnBuddyRemoved(unsigned long long ptrContext, boost::shared_ptr<BaseEvent> ptrEvent);
{
CMyClass* ptrMyClass = (CMyClass*)ptrContext;
boost::shared_ptr<map<string, boost::shared_ptr<void>>> ptrEventParams = ptrEvent->Params();
boost::shared_ptr<void> ptrEventParamValueBuddy = (*ptrEventParams)["buddy"];
boost::shared_ptr<Buddy> ptrNotifiedBuddy = ((boost::static_pointer_cast<Buddy>)(ptrEventParamValueBuddy));
// Buddy was removed
}
void CMyClass::OnBuddyError(unsigned long long ptrContext, boost::shared_ptr<BaseEvent> ptrEvent);
{
CMyClass* ptrMyClass = (CMyClass*)ptrContext;
boost::shared_ptr<map<string, boost::shared_ptr<void>>> ptrEventParams = ptrEvent->Params();
boost::shared_ptr<void> ptrEventParamValueErrorMessage = (*ptrEventParams)["errorMessage"];
boost::shared_ptr<string> ptrErrorMessage = ((boost::static_pointer_cast<string>)(ptrEventParamValueErrorMessage));
}
See also
Core.SFSBuddyEvent.BUDDY_REMOVE, Core.SFSBuddyEvent.BUDDY_ERROR, AddBuddyRequest