Do not use addParticipants to allow group chat with only one person in it + remove add to contact to ougoing messages' context menu

This commit is contained in:
Sylvain Berfini 2018-10-29 15:48:34 +01:00
parent 69ef2a8ee4
commit 3bb2e3ecdb
3 changed files with 4 additions and 6 deletions

View file

@ -426,6 +426,8 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
if (contact != null) {
menu.removeItem(R.id.add_to_contacts);
}
} else {
menu.removeItem(R.id.add_to_contacts);
}
}

View file

@ -263,14 +263,9 @@ public class GroupInfoFragment extends Fragment implements ChatRoomListener {
mWaitLayout.setVisibility(View.VISIBLE);
mTempChatRoom = LinphoneManager.getLc().createClientGroupChatRoom(mSubjectField.getText().toString(), false, mIsEncryptionEnabled);
mTempChatRoom.addListener(mChatRoomCreationListener);
Address addresses[] = new Address[mParticipants.size()];
int index = 0;
for (ContactAddress ca : mParticipants) {
addresses[index] = ca.getAddress();
index++;
mTempChatRoom.addParticipant(ca.getAddress());
}
mTempChatRoom.addParticipants(addresses);
} else {
// Subject
String newSubject = mSubjectField.getText().toString();

View file

@ -124,6 +124,7 @@ public class ImdnFragment extends Fragment {
refreshInfo();
}
};
if (mMessage == null) return null;
mMessage.setListener(mListener);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);