aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-03 16:04:27 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-03 16:04:27 +0100
commit7d79852c8403a8882061480cfb524724b84857ec (patch)
treef5c33e5753ce99199ebc26639299549e4ff5f510 /src/de/gultsch/chat
parent3d9294684c739cc54de8dfa08ad22097ca8a1811 (diff)
fixed a bug in xml parsing
Diffstat (limited to 'src/de/gultsch/chat')
-rw-r--r--src/de/gultsch/chat/services/XmppConnectionService.java6
-rw-r--r--src/de/gultsch/chat/ui/NewConversationActivity.java4
-rw-r--r--src/de/gultsch/chat/xml/XmlReader.java6
-rw-r--r--src/de/gultsch/chat/xmpp/XmppConnection.java2
4 files changed, 10 insertions, 8 deletions
diff --git a/src/de/gultsch/chat/services/XmppConnectionService.java b/src/de/gultsch/chat/services/XmppConnectionService.java
index d7ee76eec..fa2e6d7e7 100644
--- a/src/de/gultsch/chat/services/XmppConnectionService.java
+++ b/src/de/gultsch/chat/services/XmppConnectionService.java
@@ -47,7 +47,6 @@ public class XmppConnectionService extends Service {
@Override
public void onMessagePacketReceived(Account account, MessagePacket packet) {
if (packet.getType()==MessagePacket.TYPE_CHAT) {
- Log.d(LOGTAG,account.getJid()+": message of type chat");
String fullJid = packet.getFrom();
String jid = fullJid.split("/")[0];
String name = jid.split("@")[0];
@@ -132,7 +131,6 @@ public class XmppConnectionService extends Service {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
Element roster = packet.findChild("query");
- Log.d(LOGTAG,roster.toString());
List<Contact> contacts = new ArrayList<Contact>();
for(Element item : roster.getChildren()) {
String name = item.getAttribute("name");
@@ -182,10 +180,10 @@ public class XmppConnectionService extends Service {
}
public Conversation findOrCreateConversation(Account account, Contact contact) {
- Log.d(LOGTAG,"was asked to find conversation for "+contact.getJid());
+ //Log.d(LOGTAG,"was asked to find conversation for "+contact.getJid());
for(Conversation conv : this.getConversations()) {
if ((conv.getAccount().equals(account))&&(conv.getContactJid().equals(contact.getJid()))) {
- Log.d(LOGTAG,"found one in memory");
+ //Log.d(LOGTAG,"found one in memory");
return conv;
}
}
diff --git a/src/de/gultsch/chat/ui/NewConversationActivity.java b/src/de/gultsch/chat/ui/NewConversationActivity.java
index b41ca7614..bcd7fc9d0 100644
--- a/src/de/gultsch/chat/ui/NewConversationActivity.java
+++ b/src/de/gultsch/chat/ui/NewConversationActivity.java
@@ -29,6 +29,7 @@ import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.ImageView;
+import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
@@ -67,9 +68,10 @@ public class NewConversationActivity extends XmppActivity {
Collections.sort(aggregatedContacts, new Comparator<Contact>() {
+ @SuppressLint("DefaultLocale")
@Override
public int compare(Contact lhs, Contact rhs) {
- return lhs.getDisplayName().compareTo(rhs.getDisplayName());
+ return lhs.getDisplayName().toLowerCase().compareTo(rhs.getDisplayName().toLowerCase());
}
});
diff --git a/src/de/gultsch/chat/xml/XmlReader.java b/src/de/gultsch/chat/xml/XmlReader.java
index 8963f8d7a..e94296659 100644
--- a/src/de/gultsch/chat/xml/XmlReader.java
+++ b/src/de/gultsch/chat/xml/XmlReader.java
@@ -86,8 +86,10 @@ public class XmlReader {
}
//Log.d(LOGTAG,"reading till the end of "+element.getName());
while(!nextTag.isEnd(element.getName())) {
- Element child = this.readElement(nextTag);
- element.addChild(child);
+ if (!nextTag.isNo()) {
+ Element child = this.readElement(nextTag);
+ element.addChild(child);
+ }
nextTag = this.readTag();
}
//Log.d(LOGTAG,"return with element"+element);
diff --git a/src/de/gultsch/chat/xmpp/XmppConnection.java b/src/de/gultsch/chat/xmpp/XmppConnection.java
index 2303d2394..1afe5b0cc 100644
--- a/src/de/gultsch/chat/xmpp/XmppConnection.java
+++ b/src/de/gultsch/chat/xmpp/XmppConnection.java
@@ -299,7 +299,7 @@ public class XmppConnection implements Runnable {
iqPacketCallbacks.put(id, callback);
}
tagWriter.flush();
- Log.d(LOGTAG,"sending: "+packet.toString());
+ Log.d(LOGTAG,account.getJid()+": sending: "+packet.toString());
}
public void sendMessagePacket(MessagePacket packet) throws IOException {