floo::BMXGroupService

Group Service

#include <bmx_group_service.h>

Public Types

Name
typedef std::function< void(int percent)> Callback
typedef std::shared_ptr< [CreateGroupOptions] > CreateGroupOptionsPtr

Public Functions

Name
virtual ~BMXGroupService()
virtual BMXErrorCode get(BMXGroupList & list, bool forceRefresh) =0
Get group list, pull from server if forceRefreshed is set
virtual BMXErrorCode search(BMXGroupList & list, bool forceRefresh) =0
Deprecated.
virtual BMXErrorCode fetchGroupsByIdList(const std::vector< int64_t > & groupIdList, BMXGroupList & list, bool forceRefresh) =0
Get a list of group information from the ID list passed in to group, or pull from server if forceRefresh is set
virtual BMXErrorCode search(const std::vector< int64_t > & groupIdList, BMXGroupList & list, bool forceRefresh) =0
Deprecated.
virtual BMXErrorCode fetchGroupById(int64_t groupId, BMXGroupPtr & group, bool forceRefresh) =0
Get group information by group id, or pull from server if forceRefresh is set
virtual BMXErrorCode search(int64_t groupId, BMXGroupPtr & group, bool forceRefresh) =0
Deprecated.
virtual BMXErrorCode fetchLocalGroupsByName(BMXGroupList & list, const std::string & name) =0
Query local group information by group name and retrieve the group from local database by group name query
virtual BMXErrorCode search(BMXGroupList & list, const std::string & name) =0
Deprecated.
virtual BMXErrorCode create(const [CreateGroupOptions] & options, BMXGroupPtr & group) =0
Create group
virtual BMXErrorCode destroy(BMXGroupPtr group) =0
Destroy group
virtual BMXErrorCode join(BMXGroupPtr group, const std::string & message) =0
Join a group, which may require admin approval depending on group settings
virtual BMXErrorCode leave(BMXGroupPtr group) =0
Quit group
virtual BMXErrorCode getInfo(BMXGroupPtr group) =0
Get group details, pull the latest information from server
virtual BMXErrorCode getMembersNickname(BMXGroupPtr group, const std::vector< int64_t > & members, BMXGroup::MemberList & list) =0
Get group member details
virtual BMXErrorCode getInvitationList(BMXGroupInvitationPagePtr & result, const std::string & cursor ="", int pageSize =10) =0
Get group invitation list in pages
virtual BMXErrorCode getApplicationList(BMXGroupList list, BMXGroupApplicationPagePtr & result, const std::string & cursor ="", int pageSize =10) =0
Get a list of group applications in pages
virtual BMXErrorCode getMembers(BMXGroupPtr group, BMXGroupMemberResultPagePtr & result, const std::string & cursor ="", int pageSize =200) =0
Get list of group members in pages, pull from server if forceRefresh is set, up to 500 per page.
virtual BMXErrorCode getMembers(BMXGroupPtr group, BMXGroup::MemberList & list, bool forceRefresh) =0
Get group member list, pull from server if forceRefresh is set, up to 1,000
virtual BMXErrorCode addMembers(BMXGroupPtr group, const std::vector< int64_t > & members, const std::string & message) =0
Add group member
virtual BMXErrorCode removeMembers(BMXGroupPtr group, const std::vector< int64_t > & members, const std::string & reason) =0
Remove group member
virtual BMXErrorCode addAdmins(BMXGroupPtr group, const std::vector< int64_t > & admins, const std::string & message) =0
Add Admin
virtual BMXErrorCode removeAdmins(BMXGroupPtr group, const std::vector< int64_t > & admins, const std::string & reason) =0
Remove admin
virtual BMXErrorCode getAdmins(BMXGroupPtr group, BMXGroup::MemberList & list, bool forceRefresh) =0
Get Admins list, pull from server if forceRefreshed is set
virtual BMXErrorCode blockMembers(BMXGroupPtr group, const std::vector< int64_t > & members) =0
Add to blacklist
virtual BMXErrorCode unblockMembers(BMXGroupPtr group, const std::vector< int64_t > & members) =0
Unblacklist
virtual BMXErrorCode getBlockList(BMXGroupPtr group, BMXGroupMemberResultPagePtr & result, const std::string & cursor ="", int pageSize =200) =0
Paged to get blacklist
virtual BMXErrorCode getBlockList(BMXGroupPtr group, BMXGroup::MemberList & list, bool forceRefresh) =0
Get blacklist
virtual BMXErrorCode banMembers(BMXGroupPtr group, const std::vector< int64_t > & members, int64_t duration, const std::string & reason ="") =0
Ban
virtual BMXErrorCode banGroup(BMXGroupPtr group, int64_t duration) =0
Ban all members, the expiration time is calculated from the current server time plus banning duration (only Admins and group Owner can speak in the duration)
virtual BMXErrorCode unbanMembers(BMXGroupPtr group, const std::vector< int64_t > & members) =0
Unban
virtual BMXErrorCode unbanGroup(BMXGroupPtr group) =0
Unban all members
virtual BMXErrorCode getBannedMembers(BMXGroupPtr group, BMXGroupBannedMemberResultPagePtr & result, const std::string & cursor ="", int pageSize =200) =0
Paged to get ban list
virtual BMXErrorCode getBannedMembers(BMXGroupPtr group, BMXGroup::BannedMemberList & list) =0
Get a list of banned members
virtual BMXErrorCode muteMessage(BMXGroupPtr group, BMXGroup::MsgMuteMode mode) =0
Set whether to block group messages
virtual BMXErrorCode acceptApplication(BMXGroupPtr group, int64_t applicantId) =0
Accept application of membership
virtual BMXErrorCode declineApplication(BMXGroupPtr group, int64_t applicantId, const std::string & reason ="") =0
Reject application of membership
virtual BMXErrorCode acceptInvitation(BMXGroupPtr group, int64_t inviter) =0
Accept to join group
virtual BMXErrorCode declineInvitation(BMXGroupPtr group, int64_t inviter, const std::string & reason ="") =0
Reject invitation to join group
virtual BMXErrorCode transferOwner(BMXGroupPtr group, int64_t newOwnerId) =0
Transfer of group Owner
virtual BMXErrorCode uploadSharedFile(BMXGroupPtr group, const std::string & filePath, const std::string & displayName, const std::string & extensionName, Callback ) =0
Add shared file in group
virtual BMXErrorCode cancelUploadSharedFile(BMXGroupPtr group, const std::string & filePath) =0
Cancel uploading group shared files
virtual BMXErrorCode removeSharedFile(BMXGroupPtr group, BMXGroup::SharedFilePtr sharedFile) =0
Remove shared file in group
virtual BMXErrorCode downloadSharedFile(BMXGroupPtr group, BMXGroup::SharedFilePtr sharedFile, Callback ) =0
Download share file in group
virtual BMXErrorCode cancelDownloadSharedFile(BMXGroupPtr group, BMXGroup::SharedFilePtr sharedFile) =0
Cancel downloading group shared files
virtual BMXErrorCode getSharedFilesList(BMXGroupPtr group, BMXGroup::SharedFileList & list, bool forceRefresh) =0
Get a list of share files in group
virtual BMXErrorCode changeSharedFileName(BMXGroupPtr group, BMXGroup::SharedFilePtr sharedFile, const std::string & name) =0
Modify shared file name in group
virtual BMXErrorCode getLatestAnnouncement(BMXGroupPtr group, BMXGroup::AnnouncementPtr & announcement, bool forceRefresh) =0
Get the latest group announcement
virtual BMXErrorCode getAnnouncementList(BMXGroupPtr group, BMXGroup::AnnouncementList & list, bool forceRefresh) =0
Get group announcements list
virtual BMXErrorCode editAnnouncement(BMXGroupPtr group, const std::string & title, const std::string & content) =0
Write group announcement
virtual BMXErrorCode deleteAnnouncement(BMXGroupPtr group, int64_t announcementId) =0
Delete group announcement
virtual BMXErrorCode setName(BMXGroupPtr group, const std::string & name) =0
Set group name
virtual BMXErrorCode setDescription(BMXGroupPtr group, const std::string & description) =0
Set group description
virtual BMXErrorCode setExtension(BMXGroupPtr group, const std::string & extension) =0
Set group extension information
virtual BMXErrorCode setMyNickname(BMXGroupPtr group, const std::string & nickname) =0
Set nickname in group
virtual BMXErrorCode setMsgPushMode(BMXGroupPtr group, BMXGroup::MsgPushMode mode) =0
Set group message notification mode
virtual BMXErrorCode setJoinAuthMode(BMXGroupPtr group, BMXGroup::JoinAuthMode mode) =0
Set approval mode for joining group
virtual BMXErrorCode setInviteMode(BMXGroupPtr group, BMXGroup::InviteMode mode) =0
Set invitation mode
virtual BMXErrorCode setAllowMemberModify(BMXGroupPtr group, bool enable) =0
Set whether group members are allowed to set group information
virtual BMXErrorCode setEnableReadAck(BMXGroupPtr group, bool enable) =0
Set whether group message read acknowledgement is enabled
virtual BMXErrorCode setHistoryVisible(BMXGroupPtr group, bool enable) =0
Set whether group members are allowed to enable visible message history
virtual BMXErrorCode setAvatar(BMXGroupPtr group, const std::string & avatarPath, Callback ) =0
Set group avatar
virtual BMXErrorCode downloadAvatar(BMXGroupPtr group, bool thumbnail, Callback callback) =0
Download group avatar
virtual void addGroupListener(BMXGroupServiceListener * listener) =0
Add group change listener
virtual void removeGroupListener(BMXGroupServiceListener * listener) =0
Remove group change listener

Protected Functions

Name
BMXGroupService()

Public Types Documentation

typedef Callback

typedef std::function<void(int percent)> floo::BMXGroupService::Callback;

typedef CreateGroupOptionsPtr

typedef std::shared_ptr<CreateGroupOptions> floo::BMXGroupService::CreateGroupOptionsPtr;

Public Functions Documentation

function ~BMXGroupService

inline virtual ~BMXGroupService()

Example:

function get

virtual BMXErrorCode get(
    BMXGroupList & list,
    bool forceRefresh
) =0

Get group list, pull from server if forceRefreshed is set

Parameters:

  • list List of group ids, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

if (__r.get() == nullptr)
_Tp1* __tmp = __r.get();

virtual BMXErrorCode search(
    BMXGroupList & list,
    bool forceRefresh
) =0

Deprecated.

Parameters:

  • list List of group ids, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

use get instead.

Get group list, pull from server if forceRefreshed is set

Example:

BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(list, true);

function fetchGroupsByIdList

virtual BMXErrorCode fetchGroupsByIdList(
    const std::vector< int64_t > & groupIdList,
    BMXGroupList & list,
    bool forceRefresh
) =0

Get a list of group information from the ID list passed in to group, or pull from server if forceRefresh is set

Parameters:

  • groupIdList List of group ids
  • list List of group details, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

virtual BMXErrorCode search(
    const std::vector< int64_t > & groupIdList,
    BMXGroupList & list,
    bool forceRefresh
) =0

Deprecated.

Parameters:

  • groupIdList List of group ids
  • list List of group details, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

use fetchGroupsByIdList instead.

Get the list of group information for the incoming group id, pull from server if forceRefreshed is set

Example:

BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(list, true);

function fetchGroupById

virtual BMXErrorCode fetchGroupById(
    int64_t groupId,
    BMXGroupPtr & group,
    bool forceRefresh
) =0

Get group information by group id, or pull from server if forceRefresh is set

Parameters:

  • groupId Group id to search
  • group Group information returned by search, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

virtual BMXErrorCode search(
    int64_t groupId,
    BMXGroupPtr & group,
    bool forceRefresh
) =0

Deprecated.

Parameters:

  • groupId Group id to search
  • group Group information returned by search, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

use fetchGroupById instead.

Get group information, pull from server if forceRefreshed is set

Example:

BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(list, true);

function fetchLocalGroupsByName

virtual BMXErrorCode fetchLocalGroupsByName(
    BMXGroupList & list,
    const std::string & name
) =0

Query local group information by group name and retrieve the group from local database by group name query

Parameters:

  • list Group list information returned by search result
  • name Keyword of group name for query

Return: BMXErrorCode

Example:

virtual BMXErrorCode search(
    BMXGroupList & list,
    const std::string & name
) =0

Deprecated.

Parameters:

  • list Group list information returned by search result
  • name Keyword of group name for query

Return: BMXErrorCode

use fetchLocalGroupsByName instead.

Query local group information by group name and retrieve the group from local database by group name query

Example:

BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(groupId, group, false);
BMXErrorCode errorCode = client->getGroupService().search(list, true);

function create

virtual BMXErrorCode create(
    const CreateGroupOptions & options,
    BMXGroupPtr & group
) =0

Create group

Parameters:

  • options Parameters passed in when creating a group
  • group Returned result of creation, pass in a pointing-to-empty objective function shared_ptr and fetch the returned result here

Return: BMXErrorCode

Example:

client = BMXClient::create(config);

function destroy

virtual BMXErrorCode destroy(
    BMXGroupPtr group
) =0

Destroy group

Parameters:

  • group Group to destroy

Return: BMXErrorCode

Example:

allocator_traits<_Allocator>::destroy(__alloc,
{ _Base_type::destroy(__a, std::__to_address(__p));
__traits::destroy(__alloc, std::__addressof(*__orig));
_Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
{ _Alloc_traits::destroy(_M_this->_M_impl, _M_ptr());
allocator_traits<_Alloc>::destroy(_M_impl._M_alloc(), _M_ptr());
_Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
_Alloc_traits::destroy(this->_M_impl,

function join

virtual BMXErrorCode join(
    BMXGroupPtr group,
    const std::string & message
) =0

Join a group, which may require admin approval depending on group settings

Parameters:

  • group Group to join
  • message Information for group membership application

Return: BMXErrorCode

Example:

errorCode = client->getGroupService().join(group, params[1]);

function leave

virtual BMXErrorCode leave(
    BMXGroupPtr group
) =0

Quit group

Parameters:

  • group Group to quit

Return: BMXErrorCode

Example:

errorCode = client->getGroupService().leave(group);

function getInfo

virtual BMXErrorCode getInfo(
    BMXGroupPtr group
) =0

Get group details, pull the latest information from server

Parameters:

  • group Group for which the latest information needs to be obtained

Return: BMXErrorCode

Example:

function getMembersNickname

virtual BMXErrorCode getMembersNickname(
    BMXGroupPtr group,
    const std::vector< int64_t > & members,
    BMXGroup::MemberList & list
) =0

Get group member details

Parameters:

  • group Group to operate on
  • members Group member id to get group member details
  • list Returned group member details, pass in an empty list function and fetch the returned list of group member details here

Return: BMXErrorCode

Example:

function getInvitationList

virtual BMXErrorCode getInvitationList(
    BMXGroupInvitationPagePtr & result,
    const std::string & cursor ="",
    int pageSize =10
) =0

Get group invitation list in pages

Parameters:

  • result Paged list of group invitations, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • cursor Paged starting cursor, passed in as empty-valued first, followed by the cursor in the result returned by last operation
  • pageSize Page size

Return: BMXErrorCode

Example:

function getApplicationList

virtual BMXErrorCode getApplicationList(
    BMXGroupList list,
    BMXGroupApplicationPagePtr & result,
    const std::string & cursor ="",
    int pageSize =10
) =0

Get a list of group applications in pages

Parameters:

  • list List of group ids for which group application list information needs to be obtained
  • result Paged list of group applications, pass in a pointing-to-emtpy shared_ptr objective function and fetch the returned result here
  • cursor Paged starting cursor, passed in as empty-valued first, followed by the cursor in the result returned by last operation
  • pageSize Page size

Return: BMXErrorCode

Example:

function getMembers

virtual BMXErrorCode getMembers(
    BMXGroupPtr group,
    BMXGroupMemberResultPagePtr & result,
    const std::string & cursor ="",
    int pageSize =200
) =0

Get list of group members in pages, pull from server if forceRefresh is set, up to 500 per page.

Parameters:

  • group Group to operate on
  • result Paged list of group members, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • cursor Paged starting cursor, passed in as empty-valued first, followed by the cursor in the result returned by last operation
  • pageSize Page size

Return: BMXErrorCode

Example:

function getMembers

virtual BMXErrorCode getMembers(
    BMXGroupPtr group,
    BMXGroup::MemberList & list,
    bool forceRefresh
) =0

Get group member list, pull from server if forceRefresh is set, up to 1,000

Parameters:

  • group Group to operate on
  • list List of group members, pass in an empty list function and fetch the returned list of group details
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

function addMembers

virtual BMXErrorCode addMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members,
    const std::string & message
) =0

Add group member

Parameters:

  • group Group to operate on
  • members List of member ids to join group
  • message Reason for membership application

Return: BMXErrorCode

Example:

function removeMembers

virtual BMXErrorCode removeMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members,
    const std::string & reason
) =0

Remove group member

Parameters:

  • group Group to operate on
  • members List of group member ids to delete
  • reason Reason for deletion

Return: BMXErrorCode

Example:

function addAdmins

virtual BMXErrorCode addAdmins(
    BMXGroupPtr group,
    const std::vector< int64_t > & admins,
    const std::string & message
) =0

Add Admin

Parameters:

  • group Group to operate on
  • admins List of member ids to be added as Admins
  • message Reason for adding as Admin

Return: BMXErrorCode

Example:

function removeAdmins

virtual BMXErrorCode removeAdmins(
    BMXGroupPtr group,
    const std::vector< int64_t > & admins,
    const std::string & reason
) =0

Remove admin

Parameters:

  • group Group to operate on
  • admins List of member ids to degrade from Admins
  • reason Reason to degrade from Admin

Return: BMXErrorCode

Example:

function getAdmins

virtual BMXErrorCode getAdmins(
    BMXGroupPtr group,
    BMXGroup::MemberList & list,
    bool forceRefresh
) =0

Get Admins list, pull from server if forceRefreshed is set

Parameters:

  • group Group to operate on
  • list List of group Admins, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

function blockMembers

virtual BMXErrorCode blockMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members
) =0

Add to blacklist

Parameters:

  • group Group to operate on
  • members List of member ids to be blacklisted

Return: BMXErrorCode

Example:

function unblockMembers

virtual BMXErrorCode unblockMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members
) =0

Unblacklist

Parameters:

  • group Group to operate on
  • members List of unblacklisted user ids

Return: BMXErrorCode

Example:

function getBlockList

virtual BMXErrorCode getBlockList(
    BMXGroupPtr group,
    BMXGroupMemberResultPagePtr & result,
    const std::string & cursor ="",
    int pageSize =200
) =0

Paged to get blacklist

Parameters:

  • group Group to operate on
  • result Paged list of blacklists, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • cursor Paged starting cursor, passed in as empty-valued first, followed by the cursor in the result returned by last operation
  • pageSize Page size

Return: BMXErrorCode

Example:

function getBlockList

virtual BMXErrorCode getBlockList(
    BMXGroupPtr group,
    BMXGroup::MemberList & list,
    bool forceRefresh
) =0

Get blacklist

Parameters:

  • group Group to operate on
  • list List of group blacklists, pass in an empty list function and fetch the returned list of group details here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

function banMembers

virtual BMXErrorCode banMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members,
    int64_t duration,
    const std::string & reason =""
) =0

Ban

Parameters:

  • group Group to operate on
  • members List of banned member ids
  • duration Duration of banned
  • reason Reason for banned

Return: BMXErrorCode

Example:

function banGroup

virtual BMXErrorCode banGroup(
    BMXGroupPtr group,
    int64_t duration
) =0

Ban all members, the expiration time is calculated from the current server time plus banning duration (only Admins and group Owner can speak in the duration)

Parameters:

  • group Group to operate on
  • duration Banning duration (minute)

Return: BMXErrorCode

Example:

function unbanMembers

virtual BMXErrorCode unbanMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members
) =0

Unban

Parameters:

  • group Group to operate on
  • members List of unbanned group member ids

Return: BMXErrorCode

Example:

function unbanGroup

virtual BMXErrorCode unbanGroup(
    BMXGroupPtr group
) =0

Unban all members

Parameters:

  • group Group to operate on

Return: BMXErrorCode

Example:

function getBannedMembers

virtual BMXErrorCode getBannedMembers(
    BMXGroupPtr group,
    BMXGroupBannedMemberResultPagePtr & result,
    const std::string & cursor ="",
    int pageSize =200
) =0

Paged to get ban list

Parameters:

  • group Group to operate on
  • result Paged ban list, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • cursor Paged starting cursor, passed in as empty-valued first, followed by the cursor in the result returned by last operation
  • pageSize Page size

Return: BMXErrorCode

Example:

function getBannedMembers

virtual BMXErrorCode getBannedMembers(
    BMXGroupPtr group,
    BMXGroup::BannedMemberList & list
) =0

Get a list of banned members

Parameters:

  • group Group to operate on
  • list Group ban list, pass in an empty list function and fetch the returned list of group details here

Return: BMXErrorCode

Example:

function muteMessage

virtual BMXErrorCode muteMessage(
    BMXGroupPtr group,
    BMXGroup::MsgMuteMode mode
) =0

Set whether to block group messages

Parameters:

  • group Group to operate on
  • mode Group blocking mode

Return: BMXErrorCode

Example:

function acceptApplication

virtual BMXErrorCode acceptApplication(
    BMXGroupPtr group,
    int64_t applicantId
) =0

Accept application of membership

Parameters:

  • group Group to operate on
  • applicantId User id that request to join group

Return: BMXErrorCode

Example:

function declineApplication

virtual BMXErrorCode declineApplication(
    BMXGroupPtr group,
    int64_t applicantId,
    const std::string & reason =""
) =0

Reject application of membership

Parameters:

  • group Group to operate on
  • applicantId User id that request to join group
  • reason Reason for rejection

Return: BMXErrorCode

Example:

function acceptInvitation

virtual BMXErrorCode acceptInvitation(
    BMXGroupPtr group,
    int64_t inviter
) =0

Accept to join group

Parameters:

  • group Group to operate on
  • inviter Inviter id

Return: BMXErrorCode

Example:

function declineInvitation

virtual BMXErrorCode declineInvitation(
    BMXGroupPtr group,
    int64_t inviter,
    const std::string & reason =""
) =0

Reject invitation to join group

Parameters:

  • group Group to operate on
  • inviter Inviter id
  • reason Reason for rejection

Return: BMXErrorCode

Example:

function transferOwner

virtual BMXErrorCode transferOwner(
    BMXGroupPtr group,
    int64_t newOwnerId
) =0

Transfer of group Owner

Parameters:

  • group Group to operate on
  • newOwnerId User id that transferred as new group Owner

Return: BMXErrorCode

Example:

function uploadSharedFile

virtual BMXErrorCode uploadSharedFile(
    BMXGroupPtr group,
    const std::string & filePath,
    const std::string & displayName,
    const std::string & extensionName,
    Callback 
) =0

Add shared file in group

Parameters:

  • group Group to operate on
  • filePath Local path of file
  • displayName File display name
  • extensionName File extension name
  • Callback Upload callback function

Return: BMXErrorCode

Example:

function cancelUploadSharedFile

virtual BMXErrorCode cancelUploadSharedFile(
    BMXGroupPtr group,
    const std::string & filePath
) =0

Cancel uploading group shared files

Parameters:

  • group Group to operate on
  • filePath Local path of file

Return: BMXErrorCode

Example:

function removeSharedFile

virtual BMXErrorCode removeSharedFile(
    BMXGroupPtr group,
    BMXGroup::SharedFilePtr sharedFile
) =0

Remove shared file in group

Parameters:

  • group Group to operate on
  • sharedFile Deleted group shared file

Return: BMXErrorCode

Example:

function downloadSharedFile

virtual BMXErrorCode downloadSharedFile(
    BMXGroupPtr group,
    BMXGroup::SharedFilePtr sharedFile,
    Callback 
) =0

Download share file in group

Parameters:

  • group Group to operate on
  • sharedFile Downloaded group shared files
  • Callback Download callback function

Return: BMXErrorCode

Example:

function cancelDownloadSharedFile

virtual BMXErrorCode cancelDownloadSharedFile(
    BMXGroupPtr group,
    BMXGroup::SharedFilePtr sharedFile
) =0

Cancel downloading group shared files

Parameters:

  • group Group to operate on
  • sharedFile Downloaded group shared files

Return: BMXErrorCode

Example:

function getSharedFilesList

virtual BMXErrorCode getSharedFilesList(
    BMXGroupPtr group,
    BMXGroup::SharedFileList & list,
    bool forceRefresh
) =0

Get a list of share files in group

Parameters:

  • group Group to operate on
  • list List of group shared files, pass in an empty list function and fetch the returned list of group details here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

function changeSharedFileName

virtual BMXErrorCode changeSharedFileName(
    BMXGroupPtr group,
    BMXGroup::SharedFilePtr sharedFile,
    const std::string & name
) =0

Modify shared file name in group

Parameters:

  • group Group to operate on
  • sharedFile Group shared file to change
  • name Modified group shared file name

Return: BMXErrorCode

Example:

function getLatestAnnouncement

virtual BMXErrorCode getLatestAnnouncement(
    BMXGroupPtr group,
    BMXGroup::AnnouncementPtr & announcement,
    bool forceRefresh
) =0

Get the latest group announcement

Parameters:

  • group Group to operate on
  • announcement Latest group announcement, pass in a pointing-to-empty shared_ptr objective function and fetch the latest group announcement here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

function getAnnouncementList

virtual BMXErrorCode getAnnouncementList(
    BMXGroupPtr group,
    BMXGroup::AnnouncementList & list,
    bool forceRefresh
) =0

Get group announcements list

Parameters:

  • group Group to operate on
  • list List of group announcements, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

function editAnnouncement

virtual BMXErrorCode editAnnouncement(
    BMXGroupPtr group,
    const std::string & title,
    const std::string & content
) =0

Write group announcement

Parameters:

  • group Group to operate on
  • title Tittle of group announcement
  • content Content of group announcement

Return: BMXErrorCode

Example:

function deleteAnnouncement

virtual BMXErrorCode deleteAnnouncement(
    BMXGroupPtr group,
    int64_t announcementId
) =0

Delete group announcement

Parameters:

  • group Group to operate on
  • announcementId Deleted group announcement id

Return: BMXErrorCode

Example:

function setName

virtual BMXErrorCode setName(
    BMXGroupPtr group,
    const std::string & name
) =0

Set group name

Parameters:

  • group Group to operate on
  • name Group name

Return: BMXErrorCode

Example:

function setDescription

virtual BMXErrorCode setDescription(
    BMXGroupPtr group,
    const std::string & description
) =0

Set group description

Parameters:

  • group Group to operate on
  • description Group description

Return: BMXErrorCode

Example:

function setExtension

virtual BMXErrorCode setExtension(
    BMXGroupPtr group,
    const std::string & extension
) =0

Set group extension information

Parameters:

  • group Group to operate on
  • extension Group extension information

Return: BMXErrorCode

Example:

function setMyNickname

virtual BMXErrorCode setMyNickname(
    BMXGroupPtr group,
    const std::string & nickname
) =0

Set nickname in group

Parameters:

  • group Group to operate on
  • nickname My nickname in group

Return: BMXErrorCode

Example:

errorCode = client->getGroupService().setMyNickname(group, params[1]);

function setMsgPushMode

virtual BMXErrorCode setMsgPushMode(
    BMXGroupPtr group,
    BMXGroup::MsgPushMode mode
) =0

Set group message notification mode

Parameters:

  • group Group to operate on
  • mode Group message notification mode

Return: BMXErrorCode

Example:

function setJoinAuthMode

virtual BMXErrorCode setJoinAuthMode(
    BMXGroupPtr group,
    BMXGroup::JoinAuthMode mode
) =0

Set approval mode for joining group

Parameters:

  • group Group to operate on
  • mode Join approval mode

Return: BMXErrorCode

Example:

function setInviteMode

virtual BMXErrorCode setInviteMode(
    BMXGroupPtr group,
    BMXGroup::InviteMode mode
) =0

Set invitation mode

Parameters:

  • group Group to operate on
  • mode Group invitation mode

Return: BMXErrorCode

Example:

function setAllowMemberModify

virtual BMXErrorCode setAllowMemberModify(
    BMXGroupPtr group,
    bool enable
) =0

Set whether group members are allowed to set group information

Parameters:

  • group Group to operate on
  • enable Whether allowed to operate

Return: BMXErrorCode

Example:

function setEnableReadAck

virtual BMXErrorCode setEnableReadAck(
    BMXGroupPtr group,
    bool enable
) =0

Set whether group message read acknowledgement is enabled

Parameters:

  • group Group to operate on
  • enable Enable or not

Return: BMXErrorCode

Example:

function setHistoryVisible

virtual BMXErrorCode setHistoryVisible(
    BMXGroupPtr group,
    bool enable
) =0

Set whether group members are allowed to enable visible message history

Parameters:

  • group Group to operate on
  • enable Enable or not

Return: BMXErrorCode

Example:

function setAvatar

virtual BMXErrorCode setAvatar(
    BMXGroupPtr group,
    const std::string & avatarPath,
    Callback 
) =0

Set group avatar

Parameters:

  • group Group to operate on
  • avatarPath Local path of group avatar file
  • Callback Upload callback function

Return: BMXErrorCode

Example:

function downloadAvatar

virtual BMXErrorCode downloadAvatar(
    BMXGroupPtr group,
    bool thumbnail,
    Callback callback
) =0

Download group avatar

Parameters:

  • group Group to operate on
  • thumbnail True to download thumbnail, false to download original image
  • callback Download callback function

Return: BMXErrorCode

Example:

function addGroupListener

virtual void addGroupListener(
    BMXGroupServiceListener * listener
) =0

Add group change listener

Parameters:

  • listener Group change listener

Example:

client->getGroupService().addGroupListener(groupListener);

function removeGroupListener

virtual void removeGroupListener(
    BMXGroupServiceListener * listener
) =0

Remove group change listener

Parameters:

  • listener Group change listener

Protected Functions Documentation

Example:

mService->removeGroupListener(this);
client->getGroupService().removeGroupListener(groupListener);

function BMXGroupService

inline BMXGroupService()

Example:


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

© 2019-2024 MaximTop | Homepage | Site Map Last modified time: 2024-09-26 03:17:35

results matching ""

    No results matching ""