mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Fix chat list
Update submodule bctoolbox
This commit is contained in:
parent
c23f4ab0a8
commit
8ea878da1d
4 changed files with 22 additions and 3 deletions
|
|
@ -45,6 +45,8 @@ store_friends=0
|
|||
activation_code_length=4
|
||||
show_login_view=1
|
||||
friendlist_subscription_enabled=1
|
||||
debug_popup_magic=#1234
|
||||
debug=1
|
||||
|
||||
[assistant]
|
||||
password_max_length=-1
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import android.widget.TextView;
|
|||
import org.linphone.contacts.ContactsManager;
|
||||
import org.linphone.core.ChatRoomListenerStub;
|
||||
import org.linphone.core.EventLog;
|
||||
import org.linphone.core.Participant;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.ui.ListSelectionHelper;
|
||||
import org.linphone.contacts.ContactsUpdatedListener;
|
||||
|
|
@ -62,7 +63,7 @@ public class ChatListFragment extends Fragment implements ContactsUpdatedListene
|
|||
private ListSelectionHelper mSelectionHelper;
|
||||
private RelativeLayout mWaitLayout;
|
||||
private int mChatRoomDeletionPendingCount;
|
||||
private ChatRoomListenerStub mChatRoomListener;
|
||||
private ChatRoomListenerStub mChatRoomListener, mChatRoomRefresher;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
|
@ -108,11 +109,20 @@ public class ChatListFragment extends Fragment implements ContactsUpdatedListene
|
|||
@Override
|
||||
public void onChatRoomStateChanged(Core lc, ChatRoom cr, ChatRoom.State state) {
|
||||
if (state == ChatRoom.State.Created) {
|
||||
if (cr != null) cr.addListener(mChatRoomRefresher);
|
||||
refreshChatRoomsList();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
mChatRoomRefresher = new ChatRoomListenerStub() {
|
||||
@Override
|
||||
public void onConferenceJoined(ChatRoom cr, EventLog eventLog) {
|
||||
refreshChatRoomsList();
|
||||
cr.removeListener(mChatRoomRefresher);
|
||||
}
|
||||
};
|
||||
|
||||
mChatRoomListener = new ChatRoomListenerStub() {
|
||||
@Override
|
||||
public void onStateChanged(ChatRoom room, ChatRoom.State state) {
|
||||
|
|
@ -130,6 +140,12 @@ public class ChatListFragment extends Fragment implements ContactsUpdatedListene
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onParticipantDeviceAdded(ChatRoom cr, EventLog eventLog) {
|
||||
super.onParticipantDeviceAdded(cr, eventLog);
|
||||
refreshChatRoomsList();
|
||||
}
|
||||
};
|
||||
|
||||
return view;
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ public class ChatRoomsAdapter extends ListSelectionAdapter {
|
|||
public void onSubjectChanged(ChatRoom cr, EventLog eventLog) {
|
||||
ChatRoomViewHolder holder = (ChatRoomViewHolder) cr.getUserData();
|
||||
holder.displayName.setText(cr.getSubject());
|
||||
refresh();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -231,7 +232,7 @@ public class ChatRoomsAdapter extends ListSelectionAdapter {
|
|||
if (contact != null) {
|
||||
holder.lastMessageSenderView.setText(contact.getFullName() + mContext.getString(R.string.separator));
|
||||
} else {
|
||||
if (isUs(LinphoneManager.getLc().getDefaultProxyConfig(), lastMessage.getFromAddress().getUsername())) {
|
||||
if (lastMessage.getFromAddress() != null && isUs(LinphoneManager.getLc().getDefaultProxyConfig(), lastMessage.getFromAddress().getUsername())) {
|
||||
holder.lastMessageSenderView.setText(mContext.getString(R.string.you) + mContext.getString(R.string.separator));
|
||||
} else {
|
||||
holder.lastMessageSenderView.setText(LinphoneUtils.getAddressDisplayName(lastMessageSenderAddress) + mContext.getString(R.string.separator));
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 64e65dc3c1b53f3c3f295aea3aeb545e9c7a2dad
|
||||
Subproject commit 7a8fb9c070ba7fe69c9c8ea471ba4e1e0d258660
|
||||
Loading…
Add table
Reference in a new issue