[Presence] isPresenceReceived updated

This commit is contained in:
Brieuc Viel 2016-04-29 09:02:56 +02:00
parent 614c6022cf
commit e8895acd68
3 changed files with 8 additions and 2 deletions

View file

@ -457,6 +457,10 @@ public class LinphoneContact implements Serializable, Comparable<LinphoneContact
return this.friend.equals(mFriend);
}
public boolean isPresenceReceived(){
return this.friend.isPresenceReceived();
}
public static LinphoneContact createContact() {
if (ContactsManager.getInstance().hasContactsAccess()) {
return createAndroidContact();

View file

@ -655,7 +655,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
PreferencesMigrator prefMigrator = new PreferencesMigrator(mServiceContext);
prefMigrator.migrateRemoteProvisioningUriIfNeeded();
prefMigrator.migrateSharingServerUrlIfNeeded();
if (prefMigrator.isMigrationNeeded()) {
prefMigrator.doMigration();
}

View file

@ -107,7 +107,8 @@ public class AvatarWithPresenceImage extends RelativeLayout implements onPresenc
PresenceModel presenceModel = contact.getFriendPresenceModel();
PresenceBasicStatus basicStatus = presenceModel.getBasicStatus();
if (basicStatus == PresenceBasicStatus.Closed) {
if(friend.getPresenceModel() != null){
if(presenceModel.getActivity() != null && contact.isPresenceReceived() ){
Log.e("===>>> updatePresenceIcon 1");
friendStatusSmall.setImageResource(R.drawable.presence_away);
friendStatusBig.setImageResource(R.drawable.presence_away);
}else {
@ -118,6 +119,7 @@ public class AvatarWithPresenceImage extends RelativeLayout implements onPresenc
friendStatusSmall.setImageResource(R.drawable.presence_online);
friendStatusBig.setImageResource(R.drawable.presence_online);
} else {
Log.e("===>>> updatePresenceIcon 2");
friendStatusSmall.setImageResource(R.drawable.presence_away);
friendStatusBig.setImageResource(R.drawable.presence_away);
}