im::floo::floolib::BMXMessageConfig

Message configuration

Inherits from BMXBaseObject

Public Functions

Name
synchronized void delete()
void setMentionAll(boolean mentionAll)
Set whether to @ all members
boolean getMentionAll()
Get whether to @ all members
void setMentionList(ListOfLongLong mentionList)
Set the list of notified member ids
ListOfLongLong getMentionList()
Get @ member list
void setMentionedMessage(String mentionedMessage)
Set @ message
String getMentionedMessage()
Get @ message
void setPushMessage(String pushMessage)
Set push message
String getPushMessage()
Get push message
void setSenderNickname(String senderNickname)
Set nickname of sender
String getSenderNickname()
Get nickname of sender
void setGroupMemberList(ListOfLongLong groupMemberList)
Set the list of member ids that require read group messages
ListOfLongLong getGroupMemberList()
Get the list of group member ids that require read group messages
void addGroupMember(long id)
Member of group member id list with read messages added
void removeGroupMember(long id)
Empty the list of member ids that require read group messages
void clearGroupMemberList()
List of member ids with read group messages emptied
void setIOSConfig(String iosConfig)
String getIOSConfig()
Get iOS message configuration
void setAndroidConfig(String androidConfig)
String getAndroidConfig()
Get Android message configuration
void setPushShowBeginTime(int beginTime)
int getPushShowBeginTime()
Get start time of push message displayed
void setPushShowEndTime(int endTime)
int getPushShowEndTime()
Get end time of push message displayed
void setPushTitle(String pushTitle)
String getPushTitle()
Get tittle of push message
boolean isSilence()
BMXMessageConfig.BadgeCountType getBadgeCountType()
int getBadgeCount(int count)
String getUsername()
Get username of message sender
String serialize()
Serialization operation
BMXMessageConfig createMessageConfig(boolean mentionAll)

Protected Functions

Name
BMXMessageConfig(long cPtr, boolean cMemoryOwn)
void finalize()
long getCPtr(BMXMessageConfig obj)

Public Functions Documentation

function delete

inline synchronized void delete()

Example:

function setMentionAll

inline void setMentionAll(
    boolean mentionAll
)

Set whether to @ all members

Parameters:

  • mentionAll

Example:

if (atMap != null && !atMap.isEmpty()) {
    BMXMessageConfig config = BMXMessageConfig.createMessageConfig(false);
    config.setSenderNickname(senderName);
    config.setPushMessage(ChatUtils.getInstance().getMessageDesc(context, msg));
    // @对象的存储信息 包括全部成员或者部分成员
    if (atMap.containsKey("-1")) {
        // @全部
        String atTitle = atMap.get("-1");
        if (!TextUtils.isEmpty(atTitle) && text.contains(atTitle)) {
            // 如果包含全部直接走全部 还需要判断文本消息是否包含完成的@名称 如果没有就不触发@
            config.setMentionAll(true);
        }
    } else {
        // @部分成员 需要遍历添加@信息
        ListOfLongLong atIds = new ListOfLongLong();
        config.setMentionAll(false);
        for (Map.Entry<String, String> entry : atMap.entrySet()) {
            // 发送文字包含@对象的名称时再加入 防止输入框@对象名称被修改
            if (entry.getValue() != null && !TextUtils.isEmpty(entry.getValue())
                    && text.contains(entry.getValue())) {
if (atMap.containsKey("-1")) {
    // @全部
    String atTitle = atMap.get("-1");
    if (!TextUtils.isEmpty(atTitle) && text.contains(atTitle)) {
        // 如果包含全部直接走全部 还需要判断文本消息是否包含完成的@名称 如果没有就不触发@
        config.setMentionAll(true);
    }
} else {
    // @部分成员 需要遍历添加@信息
    ListOfLongLong atIds = new ListOfLongLong();
    config.setMentionAll(false);
    for (Map.Entry<String, String> entry : atMap.entrySet()) {
        // 发送文字包含@对象的名称时再加入 防止输入框@对象名称被修改
        if (entry.getValue() != null && !TextUtils.isEmpty(entry.getValue())
                && text.contains(entry.getValue())) {
            // @部分成员 feed信息只需要feedId和userId 所以需要去除无用的信息
            atIds.add(Long.valueOf(entry.getKey()));
        }
    }
    config.setGroupMemberList(atIds);

function getMentionAll

inline boolean getMentionAll()

Get whether to @ all members

Return: bool

Example:

    spannableString.setSpan(new ForegroundColorSpan(Color.RED), 0, draftText.length(),
            Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    spannable.append(spannableString).append(draft);
    desc.setText(spannable);
} else {
    String msgDesc = ChatUtils.getInstance().getMessageDesc(mContext, lastMsg);
    if (lastMsg != null && lastMsg.isReceiveMsg() && lastMsg.config() != null) {
        // 有@
        try {
            BMXMessageConfig config = lastMsg.config();
            if (config.getMentionAll()) {
                msgDesc = mContext.getString(R.string.someone_at_you) + msgDesc;
            } else {
                ListOfLongLong atList = config.getMentionList();
                if (atList != null && !atList.isEmpty()) {
                    for (int i = 0; i < atList.size(); i++) {
                        if (atList.get(
                                i) == (SharePreferenceUtils.getInstance().getUserId())) {
                            msgDesc = mContext.getString(R.string.someone_at_you) + msgDesc;
                            break;

function setMentionList

inline void setMentionList(
    ListOfLongLong mentionList
)

Set the list of notified member ids

Parameters:

  • mentionList

Example:

function getMentionList

inline ListOfLongLong getMentionList()

Get @ member list

Return: std::vector

Example:

    desc.setText(spannable);
} else {
    String msgDesc = ChatUtils.getInstance().getMessageDesc(mContext, lastMsg);
    if (lastMsg != null && lastMsg.isReceiveMsg() && lastMsg.config() != null) {
        // 有@
        try {
            BMXMessageConfig config = lastMsg.config();
            if (config.getMentionAll()) {
                msgDesc = mContext.getString(R.string.someone_at_you) + msgDesc;
            } else {
                ListOfLongLong atList = config.getMentionList();
                if (atList != null && !atList.isEmpty()) {
                    for (int i = 0; i < atList.size(); i++) {
                        if (atList.get(
                                i) == (SharePreferenceUtils.getInstance().getUserId())) {
                            msgDesc = mContext.getString(R.string.someone_at_you) + msgDesc;
                            break;
                        }
                    }

function setMentionedMessage

inline void setMentionedMessage(
    String mentionedMessage
)

Set @ message

Parameters:

  • mentionedMessage

Example:

function getMentionedMessage

inline String getMentionedMessage()

Get @ message

Return: std::string

Example:

function setPushMessage

inline void setPushMessage(
    String pushMessage
)

Set push message

Parameters:

  • pushMessage

Example:

public BMXMessage sendTextMessage(Context context, BMXMessage.MessageType type, long from, long to, String text,
                                  Map<String, String> atMap, String senderName) {
    BMXMessage msg = BMXMessage.createMessage(from, to, type, to, text);
    if (msg == null) {
        return null;
    }
    // 文本功能添加@对象
    if (atMap != null && !atMap.isEmpty()) {
        BMXMessageConfig config = BMXMessageConfig.createMessageConfig(false);
        config.setSenderNickname(senderName);
        config.setPushMessage(ChatUtils.getInstance().getMessageDesc(context, msg));
        // @对象的存储信息 包括全部成员或者部分成员
        if (atMap.containsKey("-1")) {
            // @全部
            String atTitle = atMap.get("-1");
            if (!TextUtils.isEmpty(atTitle) && text.contains(atTitle)) {
                // 如果包含全部直接走全部 还需要判断文本消息是否包含完成的@名称 如果没有就不触发@
                config.setMentionAll(true);
            }
        } else {

function getPushMessage

inline String getPushMessage()

Get push message

Return: std::string

Example:

function setSenderNickname

inline void setSenderNickname(
    String senderNickname
)

Set nickname of sender

Parameters:

  • senderNickname

Example:

public BMXMessage sendTextMessage(Context context, BMXMessage.MessageType type, long from, long to, String text,
                                  Map<String, String> atMap, String senderName) {
    BMXMessage msg = BMXMessage.createMessage(from, to, type, to, text);
    if (msg == null) {
        return null;
    }
    // 文本功能添加@对象
    if (atMap != null && !atMap.isEmpty()) {
        BMXMessageConfig config = BMXMessageConfig.createMessageConfig(false);
        config.setSenderNickname(senderName);
        config.setPushMessage(ChatUtils.getInstance().getMessageDesc(context, msg));
        // @对象的存储信息 包括全部成员或者部分成员
        if (atMap.containsKey("-1")) {
            // @全部
            String atTitle = atMap.get("-1");
            if (!TextUtils.isEmpty(atTitle) && text.contains(atTitle)) {
                // 如果包含全部直接走全部 还需要判断文本消息是否包含完成的@名称 如果没有就不触发@
                config.setMentionAll(true);
            }
        } else {

function getSenderNickname

inline String getSenderNickname()

Get nickname of sender

Return: std::string

Example:

function setGroupMemberList

inline void setGroupMemberList(
    ListOfLongLong groupMemberList
)

Set the list of member ids that require read group messages

Parameters:

  • groupMemberList

Example:

        ListOfLongLong atIds = new ListOfLongLong();
        config.setMentionAll(false);
        for (Map.Entry<String, String> entry : atMap.entrySet()) {
            // 发送文字包含@对象的名称时再加入 防止输入框@对象名称被修改
            if (entry.getValue() != null && !TextUtils.isEmpty(entry.getValue())
                    && text.contains(entry.getValue())) {
                // @部分成员 feed信息只需要feedId和userId 所以需要去除无用的信息
                atIds.add(Long.valueOf(entry.getKey()));
            }
        }
        config.setGroupMemberList(atIds);
    }
}
return handlerMessage(msg);

function getGroupMemberList

inline ListOfLongLong getGroupMemberList()

Get the list of group member ids that require read group messages

Return: std::vector

Example:

function addGroupMember

inline void addGroupMember(
    long id
)

Member of group member id list with read messages added

Example:

function removeGroupMember

inline void removeGroupMember(
    long id
)

Empty the list of member ids that require read group messages

Example:

function clearGroupMemberList

inline void clearGroupMemberList()

List of member ids with read group messages emptied

Example:

function setIOSConfig

inline void setIOSConfig(
    String iosConfig
)

Example:

function getIOSConfig

inline String getIOSConfig()

Get iOS message configuration

Example:

function setAndroidConfig

inline void setAndroidConfig(
    String androidConfig
)

Example:

function getAndroidConfig

inline String getAndroidConfig()

Get Android message configuration

Example:

function setPushShowBeginTime

inline void setPushShowBeginTime(
    int beginTime
)

Example:

function getPushShowBeginTime

inline int getPushShowBeginTime()

Get start time of push message displayed

Example:

function setPushShowEndTime

inline void setPushShowEndTime(
    int endTime
)

Example:

function getPushShowEndTime

inline int getPushShowEndTime()

Get end time of push message displayed

Example:

function setPushTitle

inline void setPushTitle(
    String pushTitle
)

Example:

function getPushTitle

inline String getPushTitle()

Get tittle of push message

Example:

function isSilence

inline boolean isSilence()

Example:

function getBadgeCountType

inline BMXMessageConfig.BadgeCountType getBadgeCountType()

Example:

function getBadgeCount

inline int getBadgeCount(
    int count
)

Example:

function getUsername

inline String getUsername()

Get username of message sender

Example:

function serialize

inline String serialize()

Serialization operation

Return: std::string

Example:

function createMessageConfig

static inline BMXMessageConfig createMessageConfig(
    boolean mentionAll
)

Protected Functions Documentation

Example:

public String sendRTCCallMessage(BMXMessageConfig.RTCCallType type, long roomId, long from, long to,
                                 String pin) {
    BMXMessageConfig con = BMXMessageConfig.createMessageConfig(false);
    con.setRTCCallInfo(type, roomId, from, BMXMessageConfig.RTCRoomType.Broadcast, pin);
    con.setPushMessageLocKey("call_in");
    BMXMessage msg = BMXMessage.createRTCMessage(from, to, BMXMessage.MessageType.Single, to, "");
    msg.setConfig(con);
    msg.setExtension("{\"rtc\":\"call\"}");
    handlerMessage(msg);
    return con.getRTCCallId();
public void sendRTCPickupMessage(long from, long to, String callId) {
    BMXMessageConfig con = BMXMessageConfig.createMessageConfig(false);
    con.setRTCPickupInfo(callId);
    BMXMessage msg = BMXMessage.createRTCMessage(from, to, BMXMessage.MessageType.Single, to, "");
    msg.setConfig(con);
    handlerMessage(msg);
public void sendRTCHangupMessage(long from, long to, String callId, String content, String pushMessageLocKey, String pushMessageLocArgs, boolean peerDrop) {
    BMXMessageConfig con = BMXMessageConfig.createMessageConfig(false);
    con.setRTCHangupInfo(callId, peerDrop);
    con.setPushMessageLocKey(pushMessageLocKey);
    if (pushMessageLocArgs.length() > 0){
        con.setPushMessageLocArgs(pushMessageLocArgs);
    }
    BMXMessage msg = BMXMessage.createRTCMessage(from, to, BMXMessage.MessageType.Single, to, content);
    msg.setConfig(con);
    handlerMessage(msg);
public BMXMessage sendTextMessage(Context context, BMXMessage.MessageType type, long from, long to, String text,
                                  Map<String, String> atMap, String senderName) {
    BMXMessage msg = BMXMessage.createMessage(from, to, type, to, text);
    if (msg == null) {
        return null;
    }
    // 文本功能添加@对象
    if (atMap != null && !atMap.isEmpty()) {
        BMXMessageConfig config = BMXMessageConfig.createMessageConfig(false);
        config.setSenderNickname(senderName);
        config.setPushMessage(ChatUtils.getInstance().getMessageDesc(context, msg));
        // @对象的存储信息 包括全部成员或者部分成员
        if (atMap.containsKey("-1")) {
            // @全部
            String atTitle = atMap.get("-1");
            if (!TextUtils.isEmpty(atTitle) && text.contains(atTitle)) {
                // 如果包含全部直接走全部 还需要判断文本消息是否包含完成的@名称 如果没有就不触发@
                config.setMentionAll(true);
            }
        } else {

function BMXMessageConfig

inline BMXMessageConfig(
    long cPtr,
    boolean cMemoryOwn
)

Example:

function finalize

inline void finalize()

Example:

function getCPtr

static inline long getCPtr(
    BMXMessageConfig obj
)

Example:


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

© 2019-2023 MaximTop | Homepage Last modified time: 2023-08-09 14:48:15

results matching ""

    No results matching ""