Skip to content

Commit

Permalink
Merge pull request #268 from ksxkq/develop
Browse files Browse the repository at this point in the history
[release] v4.0.13
  • Loading branch information
ksxkq authored Jun 13, 2024
2 parents eeafcd9 + 8e1b5de commit 58dc3b9
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Change Log
==========
Version 4.0.12、4.0.13 *(2024-06-13)*
----------------------------
- 修复 从排队创建的对话,不会弹出评价弹出的问题
- 优化 判断对话的分配以及排队状态

Version 4.0.10、4.0.11 *(2024-05-09)*
----------------------------
- 新增 根据工作台配置,动态显示发图入口
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.11'
implementation 'com.meiqia:androidx:4.0.13'
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.11'
implementation 'com.meiqia:androidx:4.0.13'
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.11.jar
Binary file not shown.
Binary file added meiqiasdk/libs/meiqia-4.0.13.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import android.provider.MediaStore;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
Expand Down Expand Up @@ -57,6 +58,7 @@
import com.meiqia.core.bean.MQAgent;
import com.meiqia.core.bean.MQMessage;
import com.meiqia.core.callback.OnClientPositionInQueueCallback;
import com.meiqia.core.callback.OnGetActiveConvCallback;
import com.meiqia.core.callback.OnGetMessageListCallback;
import com.meiqia.core.callback.SuccessCallback;
import com.meiqia.meiqiasdk.R;
Expand Down Expand Up @@ -251,6 +253,29 @@ protected void onCreate(final Bundle savedInstanceState) {

MQConfig.getActivityLifecycleCallback().onActivityCreated(this, savedInstanceState);

MQManager.getInstance(getApplicationContext()).getActiveConv(new OnGetActiveConvCallback() {
@Override
public void onSuccess(boolean isConvActive, boolean queueing, int position) {
if (queueing) {
getMessageDataFromDatabaseAndLoad(() -> changeToQueueingState());
} else {
refreshConfig(isConvActive);
}
}

@Override
public void onFailure(int code, String message) {
refreshConfig(false);
}
});
}

private void refreshConfig(boolean isConvActive) {
// 已经分配了对话的情况下,不再显示询前表单
if (isConvActive) {
applyAfterRefreshConfig();
return;
}
// 刷新配置,然后决定是否跳转到询前表单或者其它界面
mController.refreshEnterpriseConfig(new SimpleCallback() {
@Override
Expand Down Expand Up @@ -1176,7 +1201,7 @@ public void run() {
}
// 如果没有加载数据,则加载数据
if (!mHasLoadData) {
getMessageDataFromDatabaseAndLoad();
getMessageDataFromDatabaseAndLoad(null);
}
if (ErrorCode.NO_AGENT_ONLINE == code) {
// 发送待发送的消息
Expand Down Expand Up @@ -1269,12 +1294,12 @@ public void onFinish() {
MQManager.getInstance(MQConversationActivity.this).getUnreadMessages(new OnGetMessageListCallback() {
@Override
public void onSuccess(List<MQMessage> messageList) {
getMessageDataFromDatabaseAndLoad();
getMessageDataFromDatabaseAndLoad(null);
}

@Override
public void onFailure(int code, String message) {
getMessageDataFromDatabaseAndLoad();
getMessageDataFromDatabaseAndLoad(null);
}
});
}
Expand All @@ -1284,7 +1309,7 @@ public void onFailure(int code, String message) {
/**
* 从数据库获取消息并加载
*/
private void getMessageDataFromDatabaseAndLoad() {
private void getMessageDataFromDatabaseAndLoad(@Nullable OnFinishCallback onFinishCallback) {
// 从数据库获取数据
mController.getMessagesFromDatabase(System.currentTimeMillis(), MESSAGE_PAGE_COUNT, new OnGetMessageListCallBack() {

Expand All @@ -1297,10 +1322,16 @@ public void onSuccess(List<BaseMessage> messageList) {
}
mChatMessageList.addAll(messageList);
loadData();
if (onFinishCallback != null) {
onFinishCallback.onFinish();
}
}

@Override
public void onFailure(int code, String responseString) {
if (onFinishCallback != null) {
onFinishCallback.onFinish();
}
}
});
}
Expand Down Expand Up @@ -2339,8 +2370,7 @@ public void onFailure(BaseMessage failureMessage, int code, String failureInfo)
addBlacklistTip(R.string.mq_blacklist_tips);
} else if (code == ErrorCode.QUEUEING) {
changeToQueueingState();
}
if (code == ErrorCode.NO_AGENT_ONLINE) {
} else if (code == ErrorCode.NO_AGENT_ONLINE) {
// 关闭留言功能的情况下,直接跳转到留言界面:如果当前客服是机器人就例外
if (isEnableGoToMessageFormActivity()) {
Intent intent = new Intent(MQConversationActivity.this, MQMessageFormActivity.class);
Expand All @@ -2350,6 +2380,8 @@ public void onFailure(BaseMessage failureMessage, int code, String failureInfo)
} else {
addLeaveMessageTip();
}
} else {
Toast.makeText(MQConversationActivity.this, "code = " + code + "\n" + "message = " + message, Toast.LENGTH_SHORT).show();
}
mChatMsgAdapter.notifyDataSetChanged();
}
Expand Down Expand Up @@ -2895,6 +2927,7 @@ public void removeQueue() {
@Override
public void queueingInitConv(long convId) {
mConversationId = String.valueOf(convId);
mMessageReceiver.setConversationId(mConversationId);
removeQueue();
setCurrentAgent(mController.getCurrentAgent());
sendDelayMessages();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ else if (MQMessageManager.ACTION_AGENT_CHANGE_EVENT.equals(action)) {
}
} else if (MQMessageManager.ACTION_INVITE_EVALUATION.equals(action)) {
String conversationId = intent.getStringExtra("conversation_id");
if (conversationId.equals(mConversationId)) {
if (TextUtils.equals(conversationId, mConversationId)) {
inviteEvaluation();
}
} else if (MQMessageManager.ACTION_AGENT_STATUS_UPDATE_EVENT.equals(action)) {
Expand Down Expand Up @@ -135,11 +135,11 @@ else if (MQMessageManager.ACTION_AGENT_CHANGE_EVENT.equals(action)) {

public abstract void socketReconnect();

protected void noAgentStatus(){
protected void noAgentStatus() {

}

protected void queueingState(){
protected void queueingState() {

}
}

0 comments on commit 58dc3b9

Please sign in to comment.