解决web段发送的消息转发异常

This commit is contained in:
guozhen
2024-12-10 17:58:47 +08:00
committed by xuhuixiang
parent d6d3391ed5
commit cb05dda558
3 changed files with 16 additions and 7 deletions

View File

@@ -47,8 +47,8 @@ android {
applicationId = "com.dskj.rbchat"
minSdk = 24
targetSdk = 34
versionCode = 191
versionName = "1.9.1"
versionCode = 192
versionName = "1.9.2"
multiDexEnabled = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" //正式
@@ -126,8 +126,8 @@ android {
"\"AIzaSyB7P1o1EIA02eWoNP_7QJ9XwWe3WkSZb9k\""
)
//测试APPKEY
manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a"
//manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f"
manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a"
// manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f"
}

View File

@@ -49,12 +49,12 @@ public interface ApiService {
/**
* 正式环境
*/
// String URL = "https://api.letschat2023.com/";
String URL = "https://api.letschat2023.com/";
/**
* 测试环境
*/
String URL = "https://api-test.letschat2023.com/";
//String URL = "https://api-test.letschat2023.com/";
String SUBSTATIONID = "1703655363476242434";

View File

@@ -672,7 +672,7 @@ public abstract class ChatBaseViewModel extends BaseViewModel {
String attachStr = forwardMessage.getAttachStr();
CustomMessageBean customMessageBean = GsonUtils.getObjFromJSON(attachStr, CustomMessageBean.class);
String data = GsonUtils.beanToJSONString(customMessageBean.getData());
if (TextUtils.isEmpty(customMessageBean.getType())) {
if (TextUtils.isEmpty(customMessageBean.getType()) || !isInteger(customMessageBean.getType())) {
return forwardMessage;
}
if (Integer.parseInt(customMessageBean.getType()) == ChatMessageType.CUSTOM_STICKER_ALBUMS) {
@@ -711,6 +711,15 @@ public abstract class ChatBaseViewModel extends BaseViewModel {
return forwardMessage;
}
private boolean isInteger(String type) {
try {
Integer.parseInt(type);
} catch (Exception e) {
return false;
}
return true;
}
public void sendLocationMessage(ChatLocationBean locationBean) {
ALog.d(LIB_TAG, TAG, "sendLocationMessage:" + locationBean);