fixed users profile picture
This commit is contained in:
parent
b6ea028a9d
commit
36dccb9f77
|
@ -161,7 +161,7 @@ public class OtrEngine implements OtrEngineHost {
|
||||||
packet.addChild("private","urn:xmpp:carbons:2");
|
packet.addChild("private","urn:xmpp:carbons:2");
|
||||||
packet.addChild("no-copy","urn:xmpp:hints");
|
packet.addChild("no-copy","urn:xmpp:hints");
|
||||||
packet.setType(MessagePacket.TYPE_CHAT);
|
packet.setType(MessagePacket.TYPE_CHAT);
|
||||||
Log.d(LOGTAG,packet.toString());
|
//Log.d(LOGTAG,packet.toString());
|
||||||
account.getXmppConnection().sendMessagePacket(packet);
|
account.getXmppConnection().sendMessagePacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,6 @@ public class Conversation extends AbstractEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startOtrSession(Context context, String presence) {
|
public void startOtrSession(Context context, String presence) {
|
||||||
Log.d("xmppService", "starting otr session with " + presence);
|
|
||||||
SessionID sessionId = new SessionID(this.getContactJid(), presence,
|
SessionID sessionId = new SessionID(this.getContactJid(), presence,
|
||||||
"xmpp");
|
"xmpp");
|
||||||
this.otrSession = new SessionImpl(sessionId, getAccount().getOtrEngine(
|
this.otrSession = new SessionImpl(sessionId, getAccount().getOtrEngine(
|
||||||
|
|
|
@ -37,6 +37,7 @@ public class MessageParser {
|
||||||
String body = packet.getBody();
|
String body = packet.getBody();
|
||||||
if (!conversation.hasValidOtrSession()) {
|
if (!conversation.hasValidOtrSession()) {
|
||||||
if (properlyAddressed) {
|
if (properlyAddressed) {
|
||||||
|
Log.d("xmppService","starting new otr session with "+packet.getFrom()+" because no valid otr session has been found");
|
||||||
conversation.startOtrSession(service.getApplicationContext(), fromParts[1]);
|
conversation.startOtrSession(service.getApplicationContext(), fromParts[1]);
|
||||||
} else {
|
} else {
|
||||||
Log.d("xmppService",account.getJid()+": ignoring otr session with "+fromParts[0]);
|
Log.d("xmppService",account.getJid()+": ignoring otr session with "+fromParts[0]);
|
||||||
|
@ -47,6 +48,7 @@ public class MessageParser {
|
||||||
if (!foreignPresence.equals(fromParts[1])) {
|
if (!foreignPresence.equals(fromParts[1])) {
|
||||||
conversation.resetOtrSession();
|
conversation.resetOtrSession();
|
||||||
if (properlyAddressed) {
|
if (properlyAddressed) {
|
||||||
|
Log.d("xmppService","replacing otr session with "+packet.getFrom());
|
||||||
conversation.startOtrSession(service.getApplicationContext(), fromParts[1]);
|
conversation.startOtrSession(service.getApplicationContext(), fromParts[1]);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -305,15 +305,19 @@ public class UIHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Bitmap getSelfContactPicture(Account account, int size, boolean showPhoneSelfContactPicture, Activity activity) {
|
public static Bitmap getSelfContactPicture(Account account, int size, boolean showPhoneSelfContactPicture, Activity activity) {
|
||||||
Uri selfiUri = PhoneHelper.getSefliUri(activity);
|
if (showPhoneSelfContactPicture) {
|
||||||
if (selfiUri != null) {
|
Uri selfiUri = PhoneHelper.getSefliUri(activity);
|
||||||
try {
|
if (selfiUri != null) {
|
||||||
return BitmapFactory.decodeStream(activity
|
try {
|
||||||
.getContentResolver().openInputStream(selfiUri));
|
return BitmapFactory.decodeStream(activity
|
||||||
} catch (FileNotFoundException e) {
|
.getContentResolver().openInputStream(selfiUri));
|
||||||
return getUnknownContactPicture(account.getJid(), size);
|
} catch (FileNotFoundException e) {
|
||||||
|
return getUnknownContactPicture(account.getJid(), size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return getUnknownContactPicture(account.getJid(), size);
|
||||||
|
} else {
|
||||||
|
return getUnknownContactPicture(account.getJid(), size);
|
||||||
}
|
}
|
||||||
return getUnknownContactPicture(account.getJid(), size);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue