fixed regression with chat markers not working

This commit is contained in:
iNPUTmice 2014-06-23 23:29:26 +02:00
parent 25e44cbf52
commit 18d0e57f52
3 changed files with 2 additions and 8 deletions

View File

@ -21,6 +21,7 @@ public class MessageGenerator {
if (conversation.getMode() == Conversation.MODE_SINGLE) { if (conversation.getMode() == Conversation.MODE_SINGLE) {
packet.setTo(message.getCounterpart()); packet.setTo(message.getCounterpart());
packet.setType(MessagePacket.TYPE_CHAT); packet.setType(MessagePacket.TYPE_CHAT);
packet.addChild("markable", "urn:xmpp:chat-markers:0");
} else { } else {
packet.setTo(message.getCounterpart().split("/")[0]); packet.setTo(message.getCounterpart().split("/")[0]);
packet.setType(MessagePacket.TYPE_GROUPCHAT); packet.setType(MessagePacket.TYPE_GROUPCHAT);

View File

@ -1,6 +1,5 @@
package eu.siacs.conversations.parser; package eu.siacs.conversations.parser;
import android.util.Log;
import net.java.otr4j.session.Session; import net.java.otr4j.session.Session;
import net.java.otr4j.session.SessionStatus; import net.java.otr4j.session.SessionStatus;
import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Account;
@ -18,7 +17,6 @@ public class MessageParser extends AbstractParser {
} }
public Message parseChat(MessagePacket packet, Account account) { public Message parseChat(MessagePacket packet, Account account) {
Log.d("xmppService","received message: "+packet.toString());
String[] fromParts = packet.getFrom().split("/"); String[] fromParts = packet.getFrom().split("/");
Conversation conversation = mXmppConnectionService Conversation conversation = mXmppConnectionService
.findOrCreateConversation(account, fromParts[0], false); .findOrCreateConversation(account, fromParts[0], false);
@ -84,7 +82,6 @@ public class MessageParser extends AbstractParser {
if (body.startsWith(CryptoHelper.FILETRANSFER)) { if (body.startsWith(CryptoHelper.FILETRANSFER)) {
String key = body.substring(CryptoHelper.FILETRANSFER.length()); String key = body.substring(CryptoHelper.FILETRANSFER.length());
conversation.setSymmetricKey(CryptoHelper.hexToBytes(key)); conversation.setSymmetricKey(CryptoHelper.hexToBytes(key));
Log.d("xmppService","new symmetric key: "+CryptoHelper.bytesToHex(conversation.getSymmetricKey()));
return null; return null;
} }
conversation.setLatestMarkableMessageId(getMarkableMessageId(packet)); conversation.setLatestMarkableMessageId(getMarkableMessageId(packet));

View File

@ -33,7 +33,6 @@ import android.preference.PreferenceManager;
import android.text.Editable; import android.text.Editable;
import android.text.Selection; import android.text.Selection;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -102,7 +101,7 @@ public class ConversationFragment extends Fragment {
ConversationActivity.REQUEST_DECRYPT_PGP, null, 0, ConversationActivity.REQUEST_DECRYPT_PGP, null, 0,
0, 0); 0, 0);
} catch (SendIntentException e) { } catch (SendIntentException e) {
Log.d("xmppService", "couldnt fire intent"); //
} }
} }
} }
@ -520,9 +519,6 @@ public class ConversationFragment extends Fragment {
.getJingleConnection(); .getJingleConnection();
if (connection != null) { if (connection != null) {
connection.accept(); connection.accept();
} else {
Log.d("xmppService",
"attached jingle connection was null");
} }
} }
}); });