floo::BMXGroupServiceListener
Group change listener
#include <bmx_group_service_listener.h>
Public Functions
Name | |
---|---|
BMXGroupServiceListener() Constructor |
|
virtual | ~BMXGroupServiceListener() Destructor |
virtual void | onGroupCreate(BMXGroupPtr group) Create a group |
virtual void | onGroupListUpdate(const BMXGroupList & list) Group list updated |
virtual void | onGroupJoined(BMXGroupPtr group) Join a group |
virtual void | onGroupLeft(BMXGroupPtr group, const std::string & reason) Quit a group |
virtual void | onInvitated(int64_t groupId, int64_t inviter, const std::string & message) Group invitation received |
virtual void | onInvitationAccepted(BMXGroupPtr group, int64_t inviteeId) Group invitation accepted |
virtual void | onInvitationDeclined(BMXGroupPtr group, int64_t inviteeId, const std::string & reason) Join group rejected |
virtual void | onApplied(BMXGroupPtr group, int64_t applicantId, const std::string & message) Group membership application received |
virtual void | onApplicationAccepted(BMXGroupPtr group, int64_t approver) Join group accepted |
virtual void | onApplicationDeclined(BMXGroupPtr group, int64_t approver, const std::string & reason) Join group rejected |
virtual void | onMembersBanned(BMXGroupPtr group, const std::vector< int64_t > & members, int64_t duration) Member banned |
virtual void | onMembersUnbanned(BMXGroupPtr group, const std::vector< int64_t > & members) Member unbanned |
virtual void | onMemberJoined(BMXGroupPtr group, int64_t memberId, int64_t inviter) New member added |
virtual void | onMemberLeft(BMXGroupPtr group, int64_t memberId, const std::string & reason) Member quit |
virtual void | onAdminsAdded(BMXGroupPtr group, const std::vector< int64_t > & members) New Admin added |
virtual void | onAdminsRemoved(BMXGroupPtr group, const std::vector< int64_t > & members, const std::string & reason) Admin removed |
virtual void | onOwnerAssigned(BMXGroupPtr group) Become group Owner |
virtual void | onGroupInfoUpdate(BMXGroupPtr group, BMXGroup::UpdateInfoType type) Group information changes |
virtual void | onMemberChangeNickName(BMXGroupPtr group, int64_t memberId, const std::string & nickName) Member nickname changed |
virtual void | onAnnouncementUpdate(BMXGroupPtr group, BMXGroup::AnnouncementPtr announcement) Group announcement updated |
virtual void | onSharedFileUploaded(BMXGroupPtr group, BMXGroup::SharedFilePtr sharedFile) Shared file received |
virtual void | onSharedFileDeleted(BMXGroupPtr group, BMXGroup::SharedFilePtr sharedFile) Shared file deleted |
virtual void | onSharedFileUpdated(BMXGroupPtr group, BMXGroup::SharedFilePtr sharedFile) Name of shared file updated |
virtual void | onBlockListAdded(BMXGroupPtr group, const std::vector< int64_t > & members) Add to blacklist |
virtual void | onBlockListRemoved(BMXGroupPtr group, const std::vector< int64_t > & members) Delete blacklist |
virtual void | onGroupListUpdate() Triggered when client pulls a new group from server, used to update user group list, and call local fetching group via SDK for all member information |
void | registerGroupService(BMXGroupService * service) Register BMXGroupService to which BMXGroupServiceListener is bound (automatic registration in SDK) |
Protected Attributes
Name | |
---|---|
BMXGroupService * | mService |
Public Functions Documentation
function BMXGroupServiceListener
inline BMXGroupServiceListener()
Constructor
Example:
function ~BMXGroupServiceListener
inline virtual ~BMXGroupServiceListener()
Destructor
Example:
function onGroupCreate
inline virtual void onGroupCreate(
BMXGroupPtr group
)
Create a group
Parameters:
- group Newly created group
Example:
function onGroupListUpdate
inline virtual void onGroupListUpdate(
const BMXGroupList & list
)
Group list updated
Parameters:
- list Updated group list
Example:
function onGroupJoined
inline virtual void onGroupJoined(
BMXGroupPtr group
)
Join a group
Parameters:
- group Group to join
Example:
void GroupListener::onGroupJoined(BMXGroupPtr group) {
draw_notify(notifyWindow);
mvwaddstr(notifyWindow, 1, 1, "GroupListener onGroupJoined");
mvwaddstr(notifyWindow, 2, 1, std::to_string(group->groupId()).c_str());
touchwin(stdscr);
refresh();
function onGroupLeft
inline virtual void onGroupLeft(
BMXGroupPtr group,
const std::string & reason
)
Quit a group
Parameters:
- group Group to quit
- reason Quit reason
Example:
void GroupListener::onGroupLeft(BMXGroupPtr group, const std::string& reason) {
draw_notify(notifyWindow);
mvwaddstr(notifyWindow, 1, 1, "GroupListener onGroupLeft");
mvwaddstr(notifyWindow, 2, 1, std::to_string(group->groupId()).c_str());
mvwaddstr(notifyWindow, 3, 1, reason.c_str());
touchwin(stdscr);
refresh();
function onInvitated
inline virtual void onInvitated(
int64_t groupId,
int64_t inviter,
const std::string & message
)
Group invitation received
Parameters:
- groupId Group id invited to
- inviter Inviter id
- message Invitation reason
Example:
function onInvitationAccepted
inline virtual void onInvitationAccepted(
BMXGroupPtr group,
int64_t inviteeId
)
Group invitation accepted
Parameters:
- group A group in which invitation approved
- inviteeId Invitee id
Example:
function onInvitationDeclined
inline virtual void onInvitationDeclined(
BMXGroupPtr group,
int64_t inviteeId,
const std::string & reason
)
Join group rejected
Parameters:
- group A group in which invitation rejected
- inviteeId Invitee id
- reason Rejection reason
Example:
function onApplied
inline virtual void onApplied(
BMXGroupPtr group,
int64_t applicantId,
const std::string & message
)
Group membership application received
Parameters:
- group A group in which received membership application
- applicantId Applicant id
- message Application reason
Example:
function onApplicationAccepted
inline virtual void onApplicationAccepted(
BMXGroupPtr group,
int64_t approver
)
Join group accepted
Parameters:
- group Group where membership application was accepted
- approver Approver of the application
Example:
void GroupListener::onApplicationAccepted(BMXGroupPtr group, int64_t approver) {
draw_notify(notifyWindow);
mvwaddstr(notifyWindow, 1, 1, "GroupListener onApplicationAccepted");
mvwaddstr(notifyWindow, 2, 1, std::to_string(group->groupId()).c_str());
mvwaddstr(notifyWindow, 3, 1, std::to_string(approver).c_str());
touchwin(stdscr);
refresh();
function onApplicationDeclined
inline virtual void onApplicationDeclined(
BMXGroupPtr group,
int64_t approver,
const std::string & reason
)
Join group rejected
Parameters:
- group Group where membership application was rejected
- approver Approver of the application
- reason Reason for rejection
Example:
void GroupListener::onApplicationDeclined(BMXGroupPtr group, int64_t approver, const std::string& reason) {
draw_notify(notifyWindow);
mvwaddstr(notifyWindow, 1, 1, "GroupListener onApplicationDeclined");
mvwaddstr(notifyWindow, 2, 1, std::to_string(group->groupId()).c_str());
mvwaddstr(notifyWindow, 3, 1, std::to_string(approver).c_str());
mvwaddstr(notifyWindow, 4, 1, reason.c_str());
touchwin(stdscr);
refresh();
function onMembersBanned
inline virtual void onMembersBanned(
BMXGroupPtr group,
const std::vector< int64_t > & members,
int64_t duration
)
Member banned
Parameters:
- group Group with member banned
- members List of banned member ids
- duration Duration of banned
Example:
function onMembersUnbanned
inline virtual void onMembersUnbanned(
BMXGroupPtr group,
const std::vector< int64_t > & members
)
Member unbanned
Parameters:
- group Group with member unbanned
- members List of unbanned group member ids
Example:
function onMemberJoined
inline virtual void onMemberJoined(
BMXGroupPtr group,
int64_t memberId,
int64_t inviter
)
New member added
Parameters:
- group Group with new member added
- memberId ID of added member
- inviter Inviter id
Example:
function onMemberLeft
inline virtual void onMemberLeft(
BMXGroupPtr group,
int64_t memberId,
const std::string & reason
)
Member quit
Parameters:
- group Group with member quitting
- memberId ID of quitted member
- reason Reason for quitting
Example:
function onAdminsAdded
inline virtual void onAdminsAdded(
BMXGroupPtr group,
const std::vector< int64_t > & members
)
New Admin added
Parameters:
- group Group where addition of new Admin occurred
- members List of members promoted to Admins
Example:
function onAdminsRemoved
inline virtual void onAdminsRemoved(
BMXGroupPtr group,
const std::vector< int64_t > & members,
const std::string & reason
)
Admin removed
Parameters:
- group Group where Admin removal occurred
- members List of members degraded from Admins
- reason Reason for removal
Example:
function onOwnerAssigned
inline virtual void onOwnerAssigned(
BMXGroupPtr group
)
Become group Owner
Parameters:
- group A group in which group Owner transferred
Example:
function onGroupInfoUpdate
inline virtual void onGroupInfoUpdate(
BMXGroupPtr group,
BMXGroup::UpdateInfoType type
)
Group information changes
Parameters:
- group Group with group information changed
- type Type of group information that changed
Example:
function onMemberChangeNickName
inline virtual void onMemberChangeNickName(
BMXGroupPtr group,
int64_t memberId,
const std::string & nickName
)
Member nickname changed
Parameters:
- group A group in which member nickname changed
- memberId Group member id that changed group nickname
- nickName Changed group nickname
Example:
function onAnnouncementUpdate
inline virtual void onAnnouncementUpdate(
BMXGroupPtr group,
BMXGroup::AnnouncementPtr announcement
)
Group announcement updated
Parameters:
- group Group where announcement update occurred
- announcement Latest group announcement after changed
Example:
function onSharedFileUploaded
inline virtual void onSharedFileUploaded(
BMXGroupPtr group,
BMXGroup::SharedFilePtr sharedFile
)
Shared file received
Parameters:
- group A group in which shared file uploading occurred
- sharedFile Newly uploaded group shared file
Example:
function onSharedFileDeleted
inline virtual void onSharedFileDeleted(
BMXGroupPtr group,
BMXGroup::SharedFilePtr sharedFile
)
Shared file deleted
Parameters:
- group A group in which shared file deleted
- sharedFile Deleted group shared file
Example:
function onSharedFileUpdated
inline virtual void onSharedFileUpdated(
BMXGroupPtr group,
BMXGroup::SharedFilePtr sharedFile
)
Name of shared file updated
Parameters:
- group A group in which share file updated
- sharedFile Updated group shared file
Example:
function onBlockListAdded
inline virtual void onBlockListAdded(
BMXGroupPtr group,
const std::vector< int64_t > & members
)
Add to blacklist
Parameters:
- group Group with blacklist added
- members List of blacklisted members
Example:
function onBlockListRemoved
inline virtual void onBlockListRemoved(
BMXGroupPtr group,
const std::vector< int64_t > & members
)
Delete blacklist
Parameters:
- group Group with blacklist removed
- members List of unblacklisted members
Example:
function onGroupListUpdate
inline virtual void onGroupListUpdate()
Triggered when client pulls a new group from server, used to update user group list, and call local fetching group via SDK for all member information
Example:
function registerGroupService
inline void registerGroupService(
BMXGroupService * service
)
Register BMXGroupService to which BMXGroupServiceListener is bound (automatic registration in SDK)
Parameters:
- service BMXGroupService
Protected Attributes Documentation
variable mService
BMXGroupService * mService;
Example:
Updated on 2022-01-26 at 17:20:40 +0800