aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/de/gultsch/chat/crypto/OtrEngine.java1
-rw-r--r--src/de/gultsch/chat/services/XmppConnectionService.java6
-rw-r--r--src/de/gultsch/chat/ui/ConversationFragment.java18
3 files changed, 13 insertions, 12 deletions
diff --git a/src/de/gultsch/chat/crypto/OtrEngine.java b/src/de/gultsch/chat/crypto/OtrEngine.java
index f63b2904..7be9bed3 100644
--- a/src/de/gultsch/chat/crypto/OtrEngine.java
+++ b/src/de/gultsch/chat/crypto/OtrEngine.java
@@ -164,6 +164,7 @@ public class OtrEngine implements OtrEngineHost {
Element privateTag = new Element("private");
privateTag.setAttribute("xmlns","urn:xmpp:carbons:2");
packet.addChild(privateTag);
+ packet.setType(MessagePacket.TYPE_CHAT);
account.getXmppConnection().sendMessagePacket(packet);
}
diff --git a/src/de/gultsch/chat/services/XmppConnectionService.java b/src/de/gultsch/chat/services/XmppConnectionService.java
index a3e5d7cd..bb460959 100644
--- a/src/de/gultsch/chat/services/XmppConnectionService.java
+++ b/src/de/gultsch/chat/services/XmppConnectionService.java
@@ -464,17 +464,15 @@ public class XmppConnectionService extends Service {
mWhere.append("jid NOT IN(");
List<Element> items = roster.getChildren();
for(int i = 0; i < items.size(); ++i) {
- mWhere.append("\"");
mWhere.append(DatabaseUtils.sqlEscapeString(items.get(i).getAttribute("jid")));
if (i != items.size() - 1) {
- mWhere.append("\",");
- } else {
- mWhere.append("\"");
+ mWhere.append(",");
}
}
mWhere.append(") and accountUuid = \"");
mWhere.append(account.getUuid());
mWhere.append("\"");
+ Log.d(LOGTAG,mWhere.toString());
List<Contact> contactsToDelete = databaseBackend.getContats(mWhere.toString());
for(Contact contact : contactsToDelete) {
databaseBackend.deleteContact(contact);
diff --git a/src/de/gultsch/chat/ui/ConversationFragment.java b/src/de/gultsch/chat/ui/ConversationFragment.java
index 1770e7bd..b3a6ad77 100644
--- a/src/de/gultsch/chat/ui/ConversationFragment.java
+++ b/src/de/gultsch/chat/ui/ConversationFragment.java
@@ -232,18 +232,20 @@ public class ConversationFragment extends Fragment {
boolean showPhoneSelfContactPicture = sharedPref.getBoolean(
"show_phone_selfcontact_picture", true);
- Bitmap self;
+ Bitmap self = null;
if (showPhoneSelfContactPicture) {
Uri selfiUri = PhoneHelper.getSefliUri(getActivity());
- try {
- self = BitmapFactory.decodeStream(getActivity()
- .getContentResolver().openInputStream(selfiUri));
- } catch (FileNotFoundException e) {
- self = UIHelper.getUnknownContactPicture(conversation
- .getAccount().getJid(), 200);
+ if (selfiUri!=null) {
+ try {
+ self = BitmapFactory.decodeStream(getActivity()
+ .getContentResolver().openInputStream(selfiUri));
+ } catch (FileNotFoundException e) {
+ self = null;
+ }
}
- } else {
+ }
+ if (self==null){
self = UIHelper.getUnknownContactPicture(conversation.getAccount()
.getJid(), 200);
}