aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-11-24 20:55:36 +0100
committerChristian Schneppe <christian@pix-art.de>2016-11-24 20:55:36 +0100
commit5d4d04b2a448b594ebb1f75ee80e8bcf90762cf1 (patch)
tree1b2321d051af88b409410594b91738afda230dc1 /src/main
parentb945962edec63170e9f343e96df5387f3d544740 (diff)
show proper avatar for 'self' contact
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/services/AvatarService.java3
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java9
2 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AvatarService.java b/src/main/java/de/pixart/messenger/services/AvatarService.java
index 4e7c69b22..234bb9c04 100644
--- a/src/main/java/de/pixart/messenger/services/AvatarService.java
+++ b/src/main/java/de/pixart/messenger/services/AvatarService.java
@@ -44,6 +44,9 @@ public class AvatarService implements OnAdvancedStreamFeaturesLoaded {
}
private Bitmap get(final Contact contact, final int size, boolean cachedOnly) {
+ if (contact.isSelf()) {
+ return get(contact.getAccount(),size,cachedOnly);
+ }
final String KEY = key(contact, size);
Bitmap avatar = this.mXmppConnectionService.getBitmapCache().get(KEY);
if (avatar != null || cachedOnly) {
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index 547111441..10af1a0a9 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -64,7 +64,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
import de.pixart.messenger.Config;
import de.pixart.messenger.R;
import de.pixart.messenger.entities.Account;
-import de.pixart.messenger.entities.Blockable;
import de.pixart.messenger.entities.Bookmark;
import de.pixart.messenger.entities.Contact;
import de.pixart.messenger.entities.Conversation;
@@ -1055,10 +1054,14 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
activity.conference_context_id = acmi.position;
} else if (mResContextMenu == R.menu.contact_context) {
activity.contact_context_id = acmi.position;
- final Blockable contact = (Contact) activity.contacts.get(acmi.position);
+ final Contact contact = (Contact) activity.contacts.get(acmi.position);
final MenuItem blockUnblockItem = menu.findItem(R.id.context_contact_block_unblock);
+ final MenuItem showContactDetailsItem = menu.findItem(R.id.context_contact_details);
+ if (contact.isSelf()) {
+ showContactDetailsItem.setVisible(false);
+ }
XmppConnection xmpp = contact.getAccount().getXmppConnection();
- if (xmpp != null && xmpp.getFeatures().blocking()) {
+ if (xmpp != null && xmpp.getFeatures().blocking() && !contact.isSelf()) {
if (contact.isBlocked()) {
blockUnblockItem.setTitle(R.string.unblock_contact);
} else {