A bit of cleanup
This commit is contained in:
parent
42066b0249
commit
a3b3e09b78
2 changed files with 2 additions and 9 deletions
|
@ -33,7 +33,6 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import org.linphone.contacts.ContactsManager;
|
import org.linphone.contacts.ContactsManager;
|
||||||
import org.linphone.core.ChatRoomListenerStub;
|
import org.linphone.core.ChatRoomListenerStub;
|
||||||
import org.linphone.mediastream.Log;
|
|
||||||
import org.linphone.ui.ListSelectionHelper;
|
import org.linphone.ui.ListSelectionHelper;
|
||||||
import org.linphone.contacts.ContactsUpdatedListener;
|
import org.linphone.contacts.ContactsUpdatedListener;
|
||||||
import org.linphone.fragments.FragmentsAvailable;
|
import org.linphone.fragments.FragmentsAvailable;
|
||||||
|
|
|
@ -40,9 +40,6 @@ import org.linphone.core.Address;
|
||||||
import org.linphone.core.ChatMessage;
|
import org.linphone.core.ChatMessage;
|
||||||
import org.linphone.core.ChatRoom;
|
import org.linphone.core.ChatRoom;
|
||||||
import org.linphone.core.ChatRoomCapabilities;
|
import org.linphone.core.ChatRoomCapabilities;
|
||||||
import org.linphone.core.Event;
|
|
||||||
import org.linphone.core.EventLog;
|
|
||||||
import org.linphone.mediastream.Log;
|
|
||||||
import org.linphone.ui.ListSelectionAdapter;
|
import org.linphone.ui.ListSelectionAdapter;
|
||||||
import org.linphone.ui.ListSelectionHelper;
|
import org.linphone.ui.ListSelectionHelper;
|
||||||
|
|
||||||
|
@ -140,9 +137,6 @@ public class ChatRoomsAdapter extends ListSelectionAdapter {
|
||||||
contactAddress = chatRoom.getParticipants()[0].getAddress();
|
contactAddress = chatRoom.getParticipants()[0].getAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
LinphoneContact contact = null;
|
|
||||||
String message = "";
|
|
||||||
Long time;
|
|
||||||
|
|
||||||
int unreadMessagesCount = chatRoom.getUnreadMessagesCount();
|
int unreadMessagesCount = chatRoom.getUnreadMessagesCount();
|
||||||
ChatMessage lastMessage = chatRoom.getLastMessageInHistory();
|
ChatMessage lastMessage = chatRoom.getLastMessageInHistory();
|
||||||
|
@ -153,9 +147,8 @@ public class ChatRoomsAdapter extends ListSelectionAdapter {
|
||||||
if (lastMessage.getFileTransferInformation() != null || lastMessage.getExternalBodyUrl() != null || lastMessage.getAppdata() != null) {
|
if (lastMessage.getFileTransferInformation() != null || lastMessage.getExternalBodyUrl() != null || lastMessage.getAppdata() != null) {
|
||||||
holder.lastMessageView.setBackgroundResource(R.drawable.chat_file_message);
|
holder.lastMessageView.setBackgroundResource(R.drawable.chat_file_message);
|
||||||
} else if (lastMessage.getTextContent() != null && lastMessage.getTextContent().length() > 0) {
|
} else if (lastMessage.getTextContent() != null && lastMessage.getTextContent().length() > 0) {
|
||||||
message = lastMessage.getTextContent();
|
|
||||||
holder.lastMessageView.setBackgroundResource(0);
|
holder.lastMessageView.setBackgroundResource(0);
|
||||||
holder.lastMessageView.setText(message);
|
holder.lastMessageView.setText(lastMessage.getTextContent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,6 +156,7 @@ public class ChatRoomsAdapter extends ListSelectionAdapter {
|
||||||
holder.contactPicture.setImageBitmap(mDefaultBitmap);
|
holder.contactPicture.setImageBitmap(mDefaultBitmap);
|
||||||
|
|
||||||
if (chatRoom.hasCapability(ChatRoomCapabilities.OneToOne.toInt())) {
|
if (chatRoom.hasCapability(ChatRoomCapabilities.OneToOne.toInt())) {
|
||||||
|
LinphoneContact contact;
|
||||||
if (chatRoom.getParticipants().length > 0) {
|
if (chatRoom.getParticipants().length > 0) {
|
||||||
contact = ContactsManager.getInstance().findContactFromAddress(chatRoom.getParticipants()[0].getAddress());
|
contact = ContactsManager.getInstance().findContactFromAddress(chatRoom.getParticipants()[0].getAddress());
|
||||||
if (contact != null) {
|
if (contact != null) {
|
||||||
|
|
Loading…
Reference in a new issue