|
@@ -16,6 +16,7 @@ import com.cooleshow.chatmodule.contract.ChatGroupSettingContract;
|
|
|
import com.cooleshow.chatmodule.manager.IMCenter;
|
|
|
import com.tencent.imsdk.conversation.Conversation;
|
|
|
import com.tencent.imsdk.conversation.ConversationManager;
|
|
|
+import com.tencent.imsdk.v2.V2TIMCallback;
|
|
|
import com.tencent.qcloud.tuicore.util.ToastUtil;
|
|
|
import com.tencent.qcloud.tuikit.timcommon.component.interfaces.IUIKitCallback;
|
|
|
import com.tencent.qcloud.tuikit.tuigroup.bean.GroupInfo;
|
|
@@ -121,6 +122,20 @@ public class ChatGroupSettingPresenter extends BasePresenter<ChatGroupSettingCon
|
|
|
addSubscribe(create(IMApi.class).quitChatGroup(groupId, BaseConstant.CLIENT_API_GROUP_NAME), new BaseObserver<Object>() {
|
|
|
@Override
|
|
|
protected void onSuccess(Object data) {
|
|
|
+ quitGroup(groupId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(Throwable e) {
|
|
|
+ super.onError(e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ public void quitGroup(String groupId) {
|
|
|
+ IMCenter.getInstance().quitGroup(groupId, new V2TIMCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess() {
|
|
|
if (getView() != null) {
|
|
|
getView().quitChatGroupSuccess();
|
|
|
}
|
|
@@ -128,8 +143,8 @@ public class ChatGroupSettingPresenter extends BasePresenter<ChatGroupSettingCon
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void onError(Throwable e) {
|
|
|
- super.onError(e);
|
|
|
+ public void onError(int i, String s) {
|
|
|
+ ToastUtil.toastShortMessage("退出群聊失败");
|
|
|
}
|
|
|
});
|
|
|
}
|