解决web段发送的消息转发异常
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user