fix [找回密码无法登陆问题]
This commit is contained in:
@@ -11,11 +11,13 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.google.gson.Gson;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.ImUserInfoModel;
|
||||
import com.yunbao.common.dialog.DebugDialog;
|
||||
import com.yunbao.common.dialog.MessageLongClickPopuwindow;
|
||||
import com.yunbao.common.event.MessageIMEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -26,6 +28,7 @@ import java.util.List;
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.config.ConversationClickListener;
|
||||
import io.rong.imkit.manager.UnReadMessageManager;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.UserInfo;
|
||||
@@ -74,6 +77,7 @@ public class MessageIMManager {
|
||||
UnReadMessageManager.getInstance().addObserver(conversationTypes, new UnReadMessageManager.IUnReadMessageObserver() {
|
||||
@Override
|
||||
public void onCountChanged(int integer) {
|
||||
|
||||
if (!IMLoginManager.get(mContext).hintChat()) {
|
||||
imNumber = integer;
|
||||
//发送通知
|
||||
@@ -83,6 +87,24 @@ public class MessageIMManager {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
public void resetImUnReadMessageCount(Context mContext){
|
||||
RongIMClient.getInstance().getUnreadCount(new Conversation.ConversationType[]{
|
||||
Conversation.ConversationType.PRIVATE
|
||||
}, new RongIMClient.ResultCallback<Integer>() {
|
||||
@Override
|
||||
public void onSuccess(Integer integer) {
|
||||
imNumber = integer;
|
||||
//发送通知
|
||||
unreadMessagesHandler.post(essagesRunnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public MessageIMManager setSystemNumber(int systemNumber) {
|
||||
|
||||
@@ -20,6 +20,15 @@ public class AppManager {
|
||||
return SingleApp.INSTANCE;
|
||||
}
|
||||
|
||||
public Activity getMainActivity() {
|
||||
for (Activity activity : activityStack) {
|
||||
if(activity.getClass().getSimpleName().contains("MainActivity")){
|
||||
return activity;
|
||||
}
|
||||
}
|
||||
return getLastActivity();
|
||||
}
|
||||
|
||||
public static class SingleApp {
|
||||
public static AppManager INSTANCE = new AppManager();
|
||||
}
|
||||
|
||||
@@ -55,10 +55,9 @@ public class MessageChatNotifyManager {
|
||||
private synchronized void notifyLiveFlot(Context mContext) {
|
||||
String simpleName = AppManager.getInstance().getLastActivity().getClass().getSimpleName();
|
||||
if (clazzList.contains(simpleName)) {
|
||||
ToastUtil.showDebug("屏蔽类,不展示");
|
||||
// ToastUtil.showDebug("屏蔽类,不展示");
|
||||
return;
|
||||
}
|
||||
DebugDialog.getInstance((Activity) mContext).setParams("待推送通知数", startListNotifyList.size() + "");
|
||||
if (startListNotifyList.iterator().hasNext()) {
|
||||
MessageUserInfoBean bean = startListNotifyList.iterator().next();
|
||||
RongIMClient.getInstance().getUnreadCount(Conversation.ConversationType.PRIVATE, bean.getUser().getId() + "", new RongIMClient.ResultCallback<Integer>() {
|
||||
|
||||
Reference in New Issue
Block a user