/** * Sending a broadcast that the chat was closed, Only if there were new messages on this chat. * This is used for example to update the thread list that messages has been read. */ @Override protected void onStop() { super.onStop(); disposableList.dispose(); stopTyping(true); markRead(); if (thread != null && thread.typeIs(ThreadType.Public) && removeUserFromChatOnExit) { ChatSDK.thread().removeUsersFromThread(thread, ChatSDK.currentUser()).observeOn(AndroidSchedulers.mainThread()).subscribe(new CrashReportingCompletableObserver()); } }
ChatSDK.thread().removeUsersFromThread(model, currentUser).subscribe(e::onComplete, e::onError);