Fix multiple appearances of the same chat in chat list + added destroy method to linphonechatroom
This commit is contained in:
parent
b2e7abc5a2
commit
ffcb91cee7
3 changed files with 10 additions and 6 deletions
|
@ -184,11 +184,6 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
}
|
}
|
||||||
displayChat(displayName, pictureUri);
|
displayChat(displayName, pictureUri);
|
||||||
|
|
||||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
|
||||||
if (lc != null) {
|
|
||||||
chatRoom = lc.createChatRoom(sipUri);
|
|
||||||
}
|
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(LinphoneActivity.instance());
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(LinphoneActivity.instance());
|
||||||
uploadServerUri = prefs.getString(getString(R.string.pref_image_sharing_server_key), getString(R.string.pref_image_sharing_server_default));
|
uploadServerUri = prefs.getString(getString(R.string.pref_image_sharing_server_key), getString(R.string.pref_image_sharing_server_default));
|
||||||
|
|
||||||
|
@ -492,6 +487,9 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
|
if (chatRoom != null) {
|
||||||
|
chatRoom.destroy();
|
||||||
|
}
|
||||||
latestImageMessages = null;
|
latestImageMessages = null;
|
||||||
message.removeTextChangedListener(textWatcher);
|
message.removeTextChangedListener(textWatcher);
|
||||||
removeVirtualKeyboardVisiblityListener();
|
removeVirtualKeyboardVisiblityListener();
|
||||||
|
@ -515,6 +513,11 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
@SuppressLint("UseSparseArrays")
|
@SuppressLint("UseSparseArrays")
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
|
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||||
|
if (lc != null) {
|
||||||
|
chatRoom = lc.createChatRoom(sipUri);
|
||||||
|
}
|
||||||
|
|
||||||
latestImageMessages = new HashMap<Integer, String>();
|
latestImageMessages = new HashMap<Integer, String>();
|
||||||
message.addTextChangedListener(textWatcher);
|
message.addTextChangedListener(textWatcher);
|
||||||
addVirtualKeyboardVisiblityListener();
|
addVirtualKeyboardVisiblityListener();
|
||||||
|
|
|
@ -290,6 +290,7 @@ public class ChatStorage {
|
||||||
chatMessage.setUrl(message.getExternalBodyUrl());
|
chatMessage.setUrl(message.getExternalBodyUrl());
|
||||||
chatMessages.add(chatMessage);
|
chatMessages.add(chatMessage);
|
||||||
}
|
}
|
||||||
|
room.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
return chatMessages;
|
return chatMessages;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2db0e99c547779ffd34c08fa61e64f0a967ef6d6
|
Subproject commit 3e2f306e361fce90b05da1cfc7d6c16bc592df69
|
Loading…
Reference in a new issue