im::floo::floolib::BMXRosterManager

好友管理器

Public Functions

Name
BMXRosterManager(BMXRosterService service)
void get(final boolean forceRefresh, final BMXDataCallBack< ListOfLongLong > callBack)
获取好友列表,如果forceRefresh == true,则强制从服务端拉取
void search(final long rosterId, final boolean forceRefresh, final BMXDataCallBack< BMXRosterItem > callBack)
搜索用户
void search(final String name, final boolean forceRefresh, final BMXDataCallBack< BMXRosterItem > callBack)
搜索用户
void search(final ListOfLongLong rosterIdList, final boolean forceRefresh, final BMXDataCallBack< BMXRosterItemList > callBack)
批量搜索用户
void setItemExtension(final BMXRosterItem item, final String extension, final BMXCallBack callBack)
更新好友本地扩展信息
void setItemAlias(final BMXRosterItem item, final String alias, final BMXCallBack callBack)
更新好友别名
void setItemMuteNotification(final BMXRosterItem item, final boolean status, final BMXCallBack callBack)
设置是否拒收用户消息
void apply(final long rosterId, final String message, final BMXCallBack callBack)
申请添加好友
void remove(final long rosterId, final BMXCallBack callBack)
删除好友
void getApplicationList(final String cursor, final int pageSize, final BMXDataCallBack< ApplicationPage > callBack)
获取申请添加好友列表
void accept(final long rosterId, final BMXCallBack callBack)
接受加好友申请
void decline(final long rosterId, final String reason, final BMXCallBack callBack)
拒绝加好友申请
void block(final long rosterId, final BMXCallBack callBack)
加入黑名单
void unblock(final long rosterId, final BMXCallBack callBack)
从黑名单移除
void getBlockList(final boolean forceRefresh, final BMXDataCallBack< ListOfLongLong > callBack)
获取黑名单,如果forceRefresh == true,则强制从服务端拉取
void downloadAvatar(final BMXRosterItem item, final FileProgressListener listener, final BMXCallBack callBack)
下载头像
void addRosterListener(BMXRosterServiceListener listener)
添加好友变化监听者
void removeRosterListener(BMXRosterServiceListener listener)
移除好友变化监听者

Public Functions Documentation

function BMXRosterManager

inline BMXRosterManager(
    BMXRosterService service
)

Example:

function get

inline void get(
    final boolean forceRefresh,
    final BMXDataCallBack< ListOfLongLong > callBack
)

获取好友列表,如果forceRefresh == true,则强制从服务端拉取

Parameters:

  • forceRefresh 是否从服务器读取数据,true为强制从服务器获取,false情况下本地读取列表为空的情况下会自动从服务器读取
  • callBack [BMXErrorCode] 好友id列表

Example:

public void get(boolean forceRefresh, BMXDataCallBack<ListOfLongLong> callBack) {
    mService.get(forceRefresh, callBack);

inline void search(
    final long rosterId,
    final boolean forceRefresh,
    final BMXDataCallBack< BMXRosterItem > callBack
)

搜索用户

Parameters:

  • rosterId 搜索的好友id
  • forceRefresh 为true强制从服务器获取,为false情况下查询结果为空时自动从服务器获取。
  • callBack [BMXErrorCode] 查询返回的用户的信息

Example:

public void getRosterList(long rosterId, boolean forceRefresh, BMXDataCallBack<BMXRosterItem> callBack) {
    mService.search(rosterId, forceRefresh, callBack);
public void getRosterList(String name, boolean forceRefresh, BMXDataCallBack<BMXRosterItem> callBack) {
    mService.search(name, forceRefresh, callBack);
public void getRosterList(ListOfLongLong rosterIdList, boolean forceRefresh,
                          BMXDataCallBack<BMXRosterItemList> callBack) {
    mService.search(rosterIdList, forceRefresh, callBack);

inline void search(
    final String name,
    final boolean forceRefresh,
    final BMXDataCallBack< BMXRosterItem > callBack
)

搜索用户

Parameters:

  • name 搜索的用户名
  • forceRefresh 为true强制从服务器获取,为false情况下查询结果为空时自动从服务器获取。
  • callBack [BMXErrorCode] 查询返回的用户的信息

Example:

public void getRosterList(long rosterId, boolean forceRefresh, BMXDataCallBack<BMXRosterItem> callBack) {
    mService.search(rosterId, forceRefresh, callBack);
public void getRosterList(String name, boolean forceRefresh, BMXDataCallBack<BMXRosterItem> callBack) {
    mService.search(name, forceRefresh, callBack);
public void getRosterList(ListOfLongLong rosterIdList, boolean forceRefresh,
                          BMXDataCallBack<BMXRosterItemList> callBack) {
    mService.search(rosterIdList, forceRefresh, callBack);

inline void search(
    final ListOfLongLong rosterIdList,
    final boolean forceRefresh,
    final BMXDataCallBack< BMXRosterItemList > callBack
)

批量搜索用户

Parameters:

  • rosterIdList 需要搜索的用户id列表
  • forceRefresh 是否强制从服务器获取,为true则强制从服务器获取
  • callBack [BMXErrorCode] 返回的好友信息列表

Example:

public void getRosterList(long rosterId, boolean forceRefresh, BMXDataCallBack<BMXRosterItem> callBack) {
    mService.search(rosterId, forceRefresh, callBack);
public void getRosterList(String name, boolean forceRefresh, BMXDataCallBack<BMXRosterItem> callBack) {
    mService.search(name, forceRefresh, callBack);
public void getRosterList(ListOfLongLong rosterIdList, boolean forceRefresh,
                          BMXDataCallBack<BMXRosterItemList> callBack) {
    mService.search(rosterIdList, forceRefresh, callBack);

function setItemExtension

inline void setItemExtension(
    final BMXRosterItem item,
    final String extension,
    final BMXCallBack callBack
)

更新好友本地扩展信息

Parameters:

  • item 用户信息
  • extension 本地扩展信息
  • callBack [BMXErrorCode]

Example:

public void setItemExtension(BMXRosterItem item, String extension, BMXCallBack callBack) {
    mService.setItemExtension(item, extension, callBack);

function setItemAlias

inline void setItemAlias(
    final BMXRosterItem item,
    final String alias,
    final BMXCallBack callBack
)

更新好友别名

Parameters:

  • item 用户信息
  • alias 好友别名
  • callBack [BMXErrorCode]

Example:

public void setItemAlias(BMXRosterItem item, String alias, BMXCallBack callBack) {
    mService.setItemAlias(item, alias, callBack);

function setItemMuteNotification

inline void setItemMuteNotification(
    final BMXRosterItem item,
    final boolean status,
    final BMXCallBack callBack
)

设置是否拒收用户消息

Parameters:

  • item 用户信息
  • status 是否拒收用户消息,true拒收,false不拒收
  • callBack [BMXErrorCode]

Example:

public void setItemMuteNotification(BMXRosterItem item, boolean status, BMXCallBack callBack) {
    mService.setItemMuteNotification(item, status, callBack);

function apply

inline void apply(
    final long rosterId,
    final String message,
    final BMXCallBack callBack
)

申请添加好友

Parameters:

  • rosterId 申请添加的用户id
  • message 好友申请信息
  • callBack [BMXErrorCode]

Example:

public void apply(long rosterId, String reason, BMXCallBack callBack) {
    mService.apply(rosterId, reason, callBack);

function remove

inline void remove(
    final long rosterId,
    final BMXCallBack callBack
)

删除好友

Parameters:

  • rosterId 删除的好友id
  • callBack [BMXErrorCode]

Example:

public void remove(long rosterId, BMXCallBack callBack) {
    mService.remove(rosterId, callBack);

function getApplicationList

inline void getApplicationList(
    final String cursor,
    final int pageSize,
    final BMXDataCallBack< ApplicationPage > callBack
)

获取申请添加好友列表

Parameters:

  • cursor 分页获取的起始cursor,第一次传入为空,后续传入上次操作返回的result中的cursor
  • pageSize 分页大小
  • callBack [BMXErrorCode] 返回的申请好友列表信息

Example:

public void getApplicationList(String cursor, int pageSize,
        BMXDataCallBack<ApplicationPage> callBack) {
    mService.getApplicationList(cursor, pageSize, callBack);

function accept

inline void accept(
    final long rosterId,
    final BMXCallBack callBack
)

接受加好友申请

Parameters:

  • rosterId 申请加为好友的用户id
  • callBack [BMXErrorCode]

Example:

public void accept(long rosterId, BMXCallBack callBack) {
    mService.accept(rosterId, callBack);

function decline

inline void decline(
    final long rosterId,
    final String reason,
    final BMXCallBack callBack
)

拒绝加好友申请

Parameters:

  • rosterId 申请加为好友的用户id
  • reason 拒绝的原因
  • callBack [BMXErrorCode]

Example:

public void decline(long rosterId, String reason, BMXCallBack callBack) {
    mService.decline(rosterId, reason, callBack);

function block

inline void block(
    final long rosterId,
    final BMXCallBack callBack
)

加入黑名单

Parameters:

  • rosterId 加入黑名单的用户id
  • callBack [BMXErrorCode]

Example:

public void block(long rosterId, BMXCallBack callBack) {
    mService.block(rosterId, callBack);

function unblock

inline void unblock(
    final long rosterId,
    final BMXCallBack callBack
)

从黑名单移除

Parameters:

  • rosterId 从黑名单移除的用户id
  • callBack [BMXErrorCode]

Example:

public void unblock(long rosterId, BMXCallBack callBack) {
    mService.unblock(rosterId, callBack);

function getBlockList

inline void getBlockList(
    final boolean forceRefresh,
    final BMXDataCallBack< ListOfLongLong > callBack
)

获取黑名单,如果forceRefresh == true,则强制从服务端拉取

Parameters:

  • forceRefresh 是否从服务器读取数据,true为强制从服务器获取,false情况下本地读取列表为空的情况下会自动从服务器读取
  • callBack [BMXErrorCode] 好友id列表

Example:

public void getBlockList(boolean forceRefresh, BMXDataCallBack<ListOfLongLong> callBack) {
    mService.getBlockList(forceRefresh, callBack);

function downloadAvatar

inline void downloadAvatar(
    final BMXRosterItem item,
    final FileProgressListener listener,
    final BMXCallBack callBack
)

下载头像

Parameters:

  • item 用户信息
  • listener 下载回调函数
  • callBack [BMXErrorCode]

Example:

public void downloadAvatar(BMXRosterItem item, FileProgressListener listener, BMXCallBack callBack) {
    mService.downloadAvatar(item, listener, callBack);

function addRosterListener

inline void addRosterListener(
    BMXRosterServiceListener listener
)

添加好友变化监听者

Parameters:

  • listener 好友变化监听者

Example:

public void addRosterListener(BMXRosterServiceListener listener) {
    mService.addRosterListener(listener);

function removeRosterListener

inline void removeRosterListener(
    BMXRosterServiceListener listener
)

移除好友变化监听者

Parameters:

  • listener 好友变化监听者

Example:

public void removeRosterListener(BMXRosterServiceListener listener) {
    mService.removeRosterListener(listener);


Updated on 2022-01-26 at 17:18:31 +0800

© 2019-2022 美信拓扑 | 官网 该文件修订时间: 2022-09-21 11:43:07

results matching ""

    No results matching ""