floo::BMXRosterServiceListener
Friend change listener
#include <bmx_roster_service_listener.h>
Public Functions
Name | |
---|---|
BMXRosterServiceListener() Constructor |
|
virtual | ~BMXRosterServiceListener() Destructor |
virtual void | onFriendAdded(int64_t sponsorId, int64_t recipientId) Add friend |
virtual void | onFriendRemoved(int64_t sponsorId, int64_t recipientId) Delete friend |
virtual void | onApplied(int64_t sponsorId, int64_t recipientId, const std::string & message) Request of adding friend received |
virtual void | onApplicationAccepted(int64_t sponsorId, int64_t recipientId) Request of adding friend approved |
virtual void | onApplicationDeclined(int64_t sponsorId, int64_t recipientId, const std::string & reason) Request of adding friend rejected |
virtual void | onBlockListAdded(int64_t sponsorId, int64_t recipientId) Add to blacklist |
virtual void | onBlockListRemoved(int64_t sponsorId, int64_t recipientId) Delete blacklist |
virtual void | onRosterInfoUpdate(BMXRosterItemPtr item) Update user information |
virtual void | onRosterListUpdate() Triggered when client pulls new contact from server, used to update user contact list, and call local fetching contact via SDK for all member information |
void | registerRosterService(BMXRosterService * service) Register BMXRosterService to which BMXRosterServiceListener is bound (automatic registration in SDK) |
Protected Attributes
Name | |
---|---|
BMXRosterService * | mService |
Public Functions Documentation
function BMXRosterServiceListener
inline BMXRosterServiceListener()
Constructor
Example:
function ~BMXRosterServiceListener
inline virtual ~BMXRosterServiceListener()
Destructor
Example:
function onFriendAdded
inline virtual void onFriendAdded(
int64_t sponsorId,
int64_t recipientId
)
Add friend
Parameters:
- sponsorId Operation initiator
- recipientId Operation recipient
Example:
void RosterListener::onFriendAdded(int64_t sponsorId, int64_t recipientId) {
std::string sponsor = "sponsorId " + std::to_string(sponsorId);
std::string recipient = "recipientId " + std::to_string(recipientId);
draw_notify(notifyWindow);
mvwaddstr(notifyWindow, 1, 1, "RosterListener onFriendAdded");
mvwaddstr(notifyWindow, 2, 1, sponsor.c_str());
mvwaddstr(notifyWindow, 3, 1, recipient.c_str());
touchwin(stdscr);
refresh();
function onFriendRemoved
inline virtual void onFriendRemoved(
int64_t sponsorId,
int64_t recipientId
)
Delete friend
Parameters:
- sponsorId Operation initiator
- recipientId Operation recipient
Example:
void RosterListener::onFriendRemoved(int64_t sponsorId, int64_t recipientId) {
std::string sponsor = "sponsorId " + std::to_string(sponsorId);
std::string recipient = "recipientId " + std::to_string(recipientId);
draw_notify(notifyWindow);
mvwaddstr(notifyWindow, 1, 1, "RosterListener onFriendRemoved");
mvwaddstr(notifyWindow, 2, 1, sponsor.c_str());
mvwaddstr(notifyWindow, 3, 1, recipient.c_str());
touchwin(stdscr);
refresh();
function onApplied
inline virtual void onApplied(
int64_t sponsorId,
int64_t recipientId,
const std::string & message
)
Request of adding friend received
Parameters:
- sponsorId Operation initiator
- recipientId Operation recipient
- message Friend request message
Example:
void RosterListener::onApplied(int64_t sponsorId, int64_t recipientId, const std::string& message) {
std::string sponsor = "sponsorId " + std::to_string(sponsorId);
std::string recipient = "recipientId " + std::to_string(recipientId);
draw_notify(notifyWindow);
mvwaddstr(notifyWindow, 1, 1, "RosterListener onApplied");
mvwaddstr(notifyWindow, 2, 1, sponsor.c_str());
mvwaddstr(notifyWindow, 3, 1, recipient.c_str());
mvwaddstr(notifyWindow, 3, 1, message.c_str());
touchwin(stdscr);
refresh();
function onApplicationAccepted
inline virtual void onApplicationAccepted(
int64_t sponsorId,
int64_t recipientId
)
Request of adding friend approved
Parameters:
- sponsorId Operation initiator
- recipientId Operation recipient
Example:
function onApplicationDeclined
inline virtual void onApplicationDeclined(
int64_t sponsorId,
int64_t recipientId,
const std::string & reason
)
Request of adding friend rejected
Parameters:
- sponsorId Operation initiator
- recipientId Operation recipient
- reason Reason for application rejection
Example:
function onBlockListAdded
inline virtual void onBlockListAdded(
int64_t sponsorId,
int64_t recipientId
)
Add to blacklist
Parameters:
- sponsorId Operation initiator
- recipientId Operation recipient
Example:
function onBlockListRemoved
inline virtual void onBlockListRemoved(
int64_t sponsorId,
int64_t recipientId
)
Delete blacklist
Parameters:
- sponsorId Operation initiator
- recipientId Operation recipient
Example:
function onRosterInfoUpdate
inline virtual void onRosterInfoUpdate(
BMXRosterItemPtr item
)
Update user information
Parameters:
- item Updated friend information
Example:
function onRosterListUpdate
inline virtual void onRosterListUpdate()
Triggered when client pulls new contact from server, used to update user contact list, and call local fetching contact via SDK for all member information
Example:
function registerRosterService
inline void registerRosterService(
BMXRosterService * service
)
Register BMXRosterService to which BMXRosterServiceListener is bound (automatic registration in SDK)
Parameters:
- service BMXRosterService
Protected Attributes Documentation
variable mService
BMXRosterService * mService;
Example:
Updated on 2022-01-26 at 17:20:40 +0800