aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat/services
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-28 02:58:15 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-28 02:58:15 +0100
commit9581dfcde4720ede5c9fa5ca97210504b6609b3f (patch)
tree58429691f2cf772c5b7c351a045936c0603627f5 /src/de/gultsch/chat/services
parent37d1a5380634471b11c828cf265d4a39e818a1c1 (diff)
made pgp decrypt stuff a little bit more bearable
Diffstat (limited to 'src/de/gultsch/chat/services')
-rw-r--r--src/de/gultsch/chat/services/XmppConnectionService.java26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/de/gultsch/chat/services/XmppConnectionService.java b/src/de/gultsch/chat/services/XmppConnectionService.java
index a2b85f62..4e75f7aa 100644
--- a/src/de/gultsch/chat/services/XmppConnectionService.java
+++ b/src/de/gultsch/chat/services/XmppConnectionService.java
@@ -1,39 +1,21 @@
package de.gultsch.chat.services;
-import java.io.BufferedOutputStream;
-import java.io.BufferedWriter;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
import java.text.ParseException;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
import java.util.Date;
import java.util.Hashtable;
import java.util.List;
-import java.util.Set;
import org.json.JSONException;
-import org.openintents.openpgp.IOpenPgpService;
-import org.openintents.openpgp.OpenPgpSignatureResult;
import org.openintents.openpgp.util.OpenPgpApi;
import org.openintents.openpgp.util.OpenPgpServiceConnection;
-import org.openintents.openpgp.OpenPgpError;
import net.java.otr4j.OtrException;
import net.java.otr4j.session.Session;
-import net.java.otr4j.session.SessionImpl;
import net.java.otr4j.session.SessionStatus;
import de.gultsch.chat.crypto.PgpEngine;
import de.gultsch.chat.crypto.PgpEngine.OpenPgpException;
-import de.gultsch.chat.crypto.PgpEngine.UserInputRequiredException;
import de.gultsch.chat.entities.Account;
import de.gultsch.chat.entities.Contact;
import de.gultsch.chat.entities.Conversation;
@@ -67,9 +49,7 @@ import android.database.DatabaseUtils;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
-import android.os.ParcelFileDescriptor;
import android.os.PowerManager;
-import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.provider.ContactsContract;
import android.util.Log;
@@ -307,6 +287,11 @@ public class XmppConnectionService extends Service {
}
private void processRosterItems(Account account, Element elements) {
+ String version = elements.getAttribute("ver");
+ if (version != null) {
+ account.setRosterVersion(version);
+ databaseBackend.updateAccount(account);
+ }
for (Element item : elements.getChildren()) {
if (item.getName().equals("item")) {
String jid = item.getAttribute("jid");
@@ -549,7 +534,6 @@ public class XmppConnectionService extends Service {
IqPacket packet) {
Element roster = packet.findChild("query");
if (roster != null) {
- String version = roster.getAttribute("ver");
processRosterItems(account, roster);
StringBuilder mWhere = new StringBuilder();
mWhere.append("jid NOT IN(");