Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
don't let multiple calls broadcast at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
iamironrabbit committed Nov 21, 2018
1 parent 89e7542 commit b820fae
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public synchronized ChatSessionAdapter getChatSessionAdapter(ChatSession session

class ChatSessionListenerAdapter implements ChatSessionListener {

public void onChatSessionCreated(ChatSession session) {
public synchronized void onChatSessionCreated(ChatSession session) {
final IChatSession sessionAdapter = getChatSessionAdapter(session, false);
final int N = mRemoteListeners.beginBroadcast();
if (N > 0) {
Expand All @@ -251,7 +251,7 @@ public void onChatSessionCreated(ChatSession session) {
}
}

public void notifyChatSessionCreateFailed(final String name, final ImErrorInfo error) {
public synchronized void notifyChatSessionCreateFailed(final String name, final ImErrorInfo error) {
final int N = mRemoteListeners.beginBroadcast();
if (N > 0) {
for (int i = 0; i < N; i++) {
Expand Down

0 comments on commit b820fae

Please sign in to comment.