Skip to content

Commit

Permalink
[release] v4.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
ksxkq committed May 9, 2024
1 parent 081db4c commit 8cd647e
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Change Log
==========
Version 4.0.10、4.0.11 *(2024-05-09)*
----------------------------
- 新增 根据工作台配置,动态显示发图入口
- 修复 客服在线,可能会发送留言的问题
- 修复 客服撤回消息,可能还会显示的问题

Version 4.0.9 *(2024-02-20)*
----------------------------
- 新增 根据工作台配置,动态显示发图入口
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
### AndroidStudio [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.meiqia/androidx/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.meiqia/androidx)

```
implementation 'com.meiqia:androidx:4.0.9'
implementation 'com.meiqia:androidx:4.0.11'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
```
Expand Down
2 changes: 1 addition & 1 deletion demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
// implementation project(path: ':meiqiasdk')

implementation 'com.meiqia:androidx:4.0.9'
implementation 'com.meiqia:androidx:4.0.11'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
Binary file removed meiqiasdk/libs/meiqia-4.0.10.jar
Binary file not shown.
Binary file added meiqiasdk/libs/meiqia-4.0.11.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ private void loadMoreDataFromService() {
@Override
public void onSuccess(final List<BaseMessage> messageList) {
// 根据设置,过滤语音消息
cleanVoiceMessage(messageList);
cleanMessages(messageList);
if (mController.getEnterpriseConfig().isHideConversationHistory) {
keepCurrentConvMessageList(messageList);
}
Expand Down Expand Up @@ -1014,7 +1014,7 @@ private void loadMoreDataFromDatabase() {
@Override
public void onSuccess(final List<BaseMessage> messageList) {
// 根据设置,过滤语音消息
cleanVoiceMessage(messageList);
cleanMessages(messageList);
//添加时间戳
MQTimeUtils.refreshMQTimeItem(messageList);
mChatMsgAdapter.loadMoreMessage(cleanDupMessages(mChatMessageList, messageList));
Expand Down Expand Up @@ -1106,7 +1106,7 @@ public void onSuccess(Agent agent, String conversationId, List<BaseMessage> conv
mMessageReceiver.setConversationId(conversationId);

// 根据设置,过滤语音消息
cleanVoiceMessage(conversationMessageList);
cleanMessages(conversationMessageList);
if (mController.getEnterpriseConfig().isHideConversationHistory) {
keepCurrentConvMessageList(conversationMessageList);
}
Expand Down Expand Up @@ -1291,7 +1291,7 @@ private void getMessageDataFromDatabaseAndLoad() {
@Override
public void onSuccess(List<BaseMessage> messageList) {
// 根据设置,过滤语音消息
cleanVoiceMessage(messageList);
cleanMessages(messageList);
if (mController.getEnterpriseConfig().isHideConversationHistory) {
keepCurrentConvMessageList(messageList);
}
Expand Down Expand Up @@ -2477,12 +2477,14 @@ private void inputting(String content) {
*
* @param messageList 消息列表
*/
private void cleanVoiceMessage(List<BaseMessage> messageList) {
if (!MQConfig.isVoiceSwitchOpen && messageList.size() > 0) {
private void cleanMessages(List<BaseMessage> messageList) {
if (messageList.size() > 0) {
Iterator<BaseMessage> baseMessageIterator = messageList.iterator();
while (baseMessageIterator.hasNext()) {
BaseMessage baseMessage = baseMessageIterator.next();
if (BaseMessage.TYPE_CONTENT_VOICE.equals(baseMessage.getContentType())) {
if (!MQConfig.isVoiceSwitchOpen && BaseMessage.TYPE_CONTENT_VOICE.equals(baseMessage.getContentType())) {
baseMessageIterator.remove();
} else if (baseMessage.isWithdraw()) {
baseMessageIterator.remove();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class BaseMessage {
private boolean isRead;
private long conversationId;
private String fromType = TYPE_FROM_AGENT;
private boolean isWithdraw;

public BaseMessage() {
this.createdOn = System.currentTimeMillis();
Expand Down Expand Up @@ -163,6 +164,18 @@ public void setConvId(long convId) {
this.convId = convId;
}

public void setRead(boolean read) {
isRead = read;
}

public boolean isWithdraw() {
return isWithdraw;
}

public void setWithdraw(boolean withdraw) {
isWithdraw = withdraw;
}

@Override
public boolean equals(Object o) {
if (!(o instanceof BaseMessage)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ public static BaseMessage parseMQMessageToBaseMessage(MQMessage message) {
baseMessage.setIsRead(message.is_read());
baseMessage.setFromType(message.getFrom_type());
baseMessage.setConvId(message.getConversation_id());
baseMessage.setWithdraw(message.isWithdraw());
return baseMessage;
}

Expand Down

0 comments on commit 8cd647e

Please sign in to comment.