diff --git a/CHANGELOG.md b/CHANGELOG.md index 7950fb1..a41fcf3 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ Change Log ========== +Version 4.0.10、4.0.11 *(2024-05-09)* +---------------------------- +- 新增 根据工作台配置,动态显示发图入口 +- 修复 客服在线,可能会发送留言的问题 +- 修复 客服撤回消息,可能还会显示的问题 + Version 4.0.9 *(2024-02-20)* ---------------------------- - 新增 根据工作台配置,动态显示发图入口 diff --git a/README.md b/README.md index 71d877c..c00e4bb 100644 --- a/README.md +++ b/README.md @@ -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' ``` diff --git a/demo/build.gradle b/demo/build.gradle index 5fa28ab..e33e6a5 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -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' } \ No newline at end of file diff --git a/meiqiasdk/libs/meiqia-4.0.10.jar b/meiqiasdk/libs/meiqia-4.0.10.jar deleted file mode 100644 index 6432d42..0000000 Binary files a/meiqiasdk/libs/meiqia-4.0.10.jar and /dev/null differ diff --git a/meiqiasdk/libs/meiqia-4.0.11.jar b/meiqiasdk/libs/meiqia-4.0.11.jar new file mode 100644 index 0000000..970d874 Binary files /dev/null and b/meiqiasdk/libs/meiqia-4.0.11.jar differ diff --git a/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/activity/MQConversationActivity.java b/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/activity/MQConversationActivity.java index e742d59..b12e816 100644 --- a/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/activity/MQConversationActivity.java +++ b/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/activity/MQConversationActivity.java @@ -976,7 +976,7 @@ private void loadMoreDataFromService() { @Override public void onSuccess(final List messageList) { // 根据设置,过滤语音消息 - cleanVoiceMessage(messageList); + cleanMessages(messageList); if (mController.getEnterpriseConfig().isHideConversationHistory) { keepCurrentConvMessageList(messageList); } @@ -1014,7 +1014,7 @@ private void loadMoreDataFromDatabase() { @Override public void onSuccess(final List messageList) { // 根据设置,过滤语音消息 - cleanVoiceMessage(messageList); + cleanMessages(messageList); //添加时间戳 MQTimeUtils.refreshMQTimeItem(messageList); mChatMsgAdapter.loadMoreMessage(cleanDupMessages(mChatMessageList, messageList)); @@ -1106,7 +1106,7 @@ public void onSuccess(Agent agent, String conversationId, List conv mMessageReceiver.setConversationId(conversationId); // 根据设置,过滤语音消息 - cleanVoiceMessage(conversationMessageList); + cleanMessages(conversationMessageList); if (mController.getEnterpriseConfig().isHideConversationHistory) { keepCurrentConvMessageList(conversationMessageList); } @@ -1291,7 +1291,7 @@ private void getMessageDataFromDatabaseAndLoad() { @Override public void onSuccess(List messageList) { // 根据设置,过滤语音消息 - cleanVoiceMessage(messageList); + cleanMessages(messageList); if (mController.getEnterpriseConfig().isHideConversationHistory) { keepCurrentConvMessageList(messageList); } @@ -2477,12 +2477,14 @@ private void inputting(String content) { * * @param messageList 消息列表 */ - private void cleanVoiceMessage(List messageList) { - if (!MQConfig.isVoiceSwitchOpen && messageList.size() > 0) { + private void cleanMessages(List messageList) { + if (messageList.size() > 0) { Iterator 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(); } } diff --git a/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/model/BaseMessage.java b/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/model/BaseMessage.java index f9610e9..8e32ab3 100644 --- a/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/model/BaseMessage.java +++ b/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/model/BaseMessage.java @@ -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(); @@ -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)) { diff --git a/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/util/MQUtils.java b/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/util/MQUtils.java index 53741f1..3e5add7 100644 --- a/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/util/MQUtils.java +++ b/meiqiasdk/src/main/java/com/meiqia/meiqiasdk/util/MQUtils.java @@ -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; }