floo::BMXRosterServiceListener

好友变化监听者

#include <bmx_roster_service_listener.h>

Public Functions

Name
BMXRosterServiceListener()
构造函数
virtual ~BMXRosterServiceListener()
析构函数
virtual void onFriendAdded(int64_t sponsorId, int64_t recipientId)
添加好友
virtual void onFriendRemoved(int64_t sponsorId, int64_t recipientId)
删除好友
virtual void onApplied(int64_t sponsorId, int64_t recipientId, const std::string & message)
收到加好友申请
virtual void onApplicationAccepted(int64_t sponsorId, int64_t recipientId)
加好友申请被通过了
virtual void onApplicationDeclined(int64_t sponsorId, int64_t recipientId, const std::string & reason)
加好友申请被拒绝了
virtual void onBlockListAdded(int64_t sponsorId, int64_t recipientId)
添加黑名单
virtual void onBlockListRemoved(int64_t sponsorId, int64_t recipientId)
删除黑名单
virtual void onRosterInfoUpdate(BMXRosterItemPtr item)
用户信息更新
virtual void onRosterListUpdate()
客户端从服务器拉取到新联系人时触发,用于用户联系人列表更新,从SDK调用本地获取联系人即可取得全部成员信息
void registerRosterService(BMXRosterService * service)
注册BMXRosterServiceListener绑定到的BMXRosterService(SDK内部自动注册)

Protected Attributes

Name
BMXRosterService * mService

Public Functions Documentation

function BMXRosterServiceListener

inline BMXRosterServiceListener()

构造函数

Example:

function ~BMXRosterServiceListener

inline virtual ~BMXRosterServiceListener()

析构函数

Example:

function onFriendAdded

inline virtual void onFriendAdded(
    int64_t sponsorId,
    int64_t recipientId
)

添加好友

Parameters:

  • sponsorId 操作的发起者
  • recipientId 操作的接受者

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
)

删除好友

Parameters:

  • sponsorId 操作的发起者
  • recipientId 操作的接受者

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
)

收到加好友申请

Parameters:

  • sponsorId 操作的发起者
  • recipientId 操作的接受者
  • 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
)

加好友申请被通过了

Parameters:

  • sponsorId 操作的发起者
  • recipientId 操作的接受者

Example:

function onApplicationDeclined

inline virtual void onApplicationDeclined(
    int64_t sponsorId,
    int64_t recipientId,
    const std::string & reason
)

加好友申请被拒绝了

Parameters:

  • sponsorId 操作的发起者
  • recipientId 操作的接受者
  • reason 申请拒绝原因

Example:

function onBlockListAdded

inline virtual void onBlockListAdded(
    int64_t sponsorId,
    int64_t recipientId
)

添加黑名单

Parameters:

  • sponsorId 操作的发起者
  • recipientId 操作的接受者

Example:

function onBlockListRemoved

inline virtual void onBlockListRemoved(
    int64_t sponsorId,
    int64_t recipientId
)

删除黑名单

Parameters:

  • sponsorId 操作的发起者
  • recipientId 操作的接受者

Example:

function onRosterInfoUpdate

inline virtual void onRosterInfoUpdate(
    BMXRosterItemPtr item
)

用户信息更新

Parameters:

  • item 更新的好友信息

Example:

function onRosterListUpdate

inline virtual void onRosterListUpdate()

客户端从服务器拉取到新联系人时触发,用于用户联系人列表更新,从SDK调用本地获取联系人即可取得全部成员信息

Example:

function registerRosterService

inline void registerRosterService(
    BMXRosterService * service
)

注册BMXRosterServiceListener绑定到的BMXRosterService(SDK内部自动注册)

Parameters:

Protected Attributes Documentation

variable mService

BMXRosterService * mService;

Example:


Updated on 2022-01-26 at 17:20:40 +0800

© 2019-2024 美信拓扑 | 官网 | 网站地图 该文件修订时间: 2024-12-07 06:49:06