Fixed crash due to not using the local address in getChatRooms()
This commit is contained in:
parent
b6445cda7f
commit
e97a68dda5
6 changed files with 27 additions and 6 deletions
|
@ -100,7 +100,7 @@ android {
|
|||
defaultConfig {
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 29
|
||||
versionCode 4319
|
||||
versionCode 4320
|
||||
versionName "${project.version}"
|
||||
applicationId getPackageName()
|
||||
multiDexEnabled true
|
||||
|
|
|
@ -297,6 +297,7 @@ public class ChatActivity extends MainActivity {
|
|||
|
||||
public void showChatRoomGroupInfo(
|
||||
Address peerAddress,
|
||||
Address localAddress,
|
||||
ArrayList<ContactAddress> participants,
|
||||
String subject,
|
||||
boolean encrypted) {
|
||||
|
@ -304,6 +305,9 @@ public class ChatActivity extends MainActivity {
|
|||
if (peerAddress != null) {
|
||||
extras.putSerializable("RemoteSipUri", peerAddress.asStringUriOnly());
|
||||
}
|
||||
if (localAddress != null) {
|
||||
extras.putSerializable("LocalSipUri", localAddress.asStringUriOnly());
|
||||
}
|
||||
extras.putSerializable("Participants", participants);
|
||||
extras.putString("Subject", subject);
|
||||
extras.putBoolean("Encrypted", encrypted);
|
||||
|
@ -313,11 +317,14 @@ public class ChatActivity extends MainActivity {
|
|||
changeFragment(fragment, "Chat room group info", true);
|
||||
}
|
||||
|
||||
public void showChatRoomEphemeral(Address peerAddress) {
|
||||
public void showChatRoomEphemeral(Address peerAddress, Address localAddress) {
|
||||
Bundle extras = new Bundle();
|
||||
if (peerAddress != null) {
|
||||
extras.putSerializable("RemoteSipUri", peerAddress.asStringUriOnly());
|
||||
}
|
||||
if (localAddress != null) {
|
||||
extras.putSerializable("LocalSipUri", localAddress.asStringUriOnly());
|
||||
}
|
||||
EphemeralFragment fragment = new EphemeralFragment();
|
||||
fragment.setArguments(extras);
|
||||
changeFragment(fragment, "Chat room ephemeral", true);
|
||||
|
|
|
@ -1215,12 +1215,16 @@ public class ChatMessagesFragment extends Fragment
|
|||
boolean encrypted = mChatRoom.hasCapability(ChatRoomCapabilities.Encrypted.toInt());
|
||||
((ChatActivity) getActivity())
|
||||
.showChatRoomGroupInfo(
|
||||
mRemoteSipAddress, participants, mChatRoom.getSubject(), encrypted);
|
||||
mRemoteSipAddress,
|
||||
mLocalSipAddress,
|
||||
participants,
|
||||
mChatRoom.getSubject(),
|
||||
encrypted);
|
||||
}
|
||||
|
||||
private void goToEphemeral() {
|
||||
if (mChatRoom == null) return;
|
||||
((ChatActivity) getActivity()).showChatRoomEphemeral(mRemoteSipAddress);
|
||||
((ChatActivity) getActivity()).showChatRoomEphemeral(mRemoteSipAddress, mLocalSipAddress);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -154,6 +154,7 @@ public class ChatRoomCreationFragment extends Fragment
|
|||
? null
|
||||
: Factory.instance()
|
||||
.createAddress(mChatRoomAddress),
|
||||
mChatRoom == null ? null : mChatRoom.getLocalAddress(),
|
||||
mSearchAdapter.getContactsSelectedList(),
|
||||
mChatRoomSubject,
|
||||
mSecurityToggle.isChecked());
|
||||
|
|
|
@ -58,12 +58,14 @@ public class EphemeralFragment extends Fragment {
|
|||
|
||||
String address = getArguments().getString("RemoteSipUri");
|
||||
Address peerAddress = null;
|
||||
String localSipUri = getArguments().getString("LocalSipUri");
|
||||
Address localSipAddress = Factory.instance().createAddress(localSipUri);
|
||||
mChatRoom = null;
|
||||
if (address != null && address.length() > 0) {
|
||||
peerAddress = Factory.instance().createAddress(address);
|
||||
}
|
||||
if (peerAddress != null) {
|
||||
mChatRoom = LinphoneManager.getCore().getChatRoom(peerAddress);
|
||||
mChatRoom = LinphoneManager.getCore().getChatRoom(peerAddress, localSipAddress);
|
||||
}
|
||||
if (mChatRoom == null) {
|
||||
return null;
|
||||
|
|
|
@ -95,9 +95,16 @@ public class GroupInfoFragment extends Fragment {
|
|||
mGroupChatRoomAddress = Factory.instance().createAddress(address);
|
||||
}
|
||||
|
||||
Address localSipAddress = null;
|
||||
String localSipUri = getArguments().getString("LocalSipUri");
|
||||
if (localSipUri != null && localSipUri.length() > 0) {
|
||||
localSipAddress = Factory.instance().createAddress(localSipUri);
|
||||
}
|
||||
|
||||
mIsAlreadyCreatedGroup = mGroupChatRoomAddress != null;
|
||||
if (mIsAlreadyCreatedGroup) {
|
||||
mChatRoom = LinphoneManager.getCore().getChatRoom(mGroupChatRoomAddress);
|
||||
mChatRoom =
|
||||
LinphoneManager.getCore().getChatRoom(mGroupChatRoomAddress, localSipAddress);
|
||||
}
|
||||
|
||||
if (mChatRoom == null) {
|
||||
|
|
Loading…
Reference in a new issue