removed warnings
This commit is contained in:
parent
678cc7af10
commit
c25f1283a1
|
@ -2,6 +2,7 @@ package eu.siacs.conversations.generator;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import net.java.otr4j.OtrException;
|
import net.java.otr4j.OtrException;
|
||||||
|
@ -33,7 +34,7 @@ public class MessageGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addDelay(MessagePacket packet, long timestamp) {
|
private void addDelay(MessagePacket packet, long timestamp) {
|
||||||
final SimpleDateFormat mDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
final SimpleDateFormat mDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",Locale.US);
|
||||||
mDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
mDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
Element delay = packet.addChild("delay", "urn:xmpp:delay");
|
Element delay = packet.addChild("delay", "urn:xmpp:delay");
|
||||||
Date date = new Date(timestamp);
|
Date date = new Date(timestamp);
|
||||||
|
|
|
@ -3,8 +3,8 @@ package eu.siacs.conversations.parser;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
import eu.siacs.conversations.entities.Account;
|
import eu.siacs.conversations.entities.Account;
|
||||||
import eu.siacs.conversations.entities.Contact;
|
import eu.siacs.conversations.entities.Contact;
|
||||||
import eu.siacs.conversations.services.XmppConnectionService;
|
import eu.siacs.conversations.services.XmppConnectionService;
|
||||||
|
@ -26,7 +26,7 @@ public abstract class AbstractParser {
|
||||||
"stamp");
|
"stamp");
|
||||||
stamp = stamp.replace("Z", "+0000");
|
stamp = stamp.replace("Z", "+0000");
|
||||||
if (stamp.contains(".")) {
|
if (stamp.contains(".")) {
|
||||||
Date date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
|
Date date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ",Locale.US)
|
||||||
.parse(stamp);
|
.parse(stamp);
|
||||||
if (now<date.getTime()) {
|
if (now<date.getTime()) {
|
||||||
return now;
|
return now;
|
||||||
|
@ -34,7 +34,7 @@ public abstract class AbstractParser {
|
||||||
return date.getTime();
|
return date.getTime();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Date date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
|
Date date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ",Locale.US)
|
||||||
.parse(stamp);
|
.parse(stamp);
|
||||||
if (now<date.getTime()) {
|
if (now<date.getTime()) {
|
||||||
return now;
|
return now;
|
||||||
|
|
|
@ -795,7 +795,6 @@ public class XmppConnection implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendMessagePacket(MessagePacket packet) {
|
public void sendMessagePacket(MessagePacket packet) {
|
||||||
Log.d("xmppService",packet.toString());
|
|
||||||
this.sendPacket(packet, null);
|
this.sendPacket(packet, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
|
@ -13,7 +14,6 @@ import eu.siacs.conversations.entities.Account;
|
||||||
import eu.siacs.conversations.entities.Conversation;
|
import eu.siacs.conversations.entities.Conversation;
|
||||||
import eu.siacs.conversations.entities.Message;
|
import eu.siacs.conversations.entities.Message;
|
||||||
import eu.siacs.conversations.services.XmppConnectionService;
|
import eu.siacs.conversations.services.XmppConnectionService;
|
||||||
import eu.siacs.conversations.utils.CryptoHelper;
|
|
||||||
import eu.siacs.conversations.xml.Element;
|
import eu.siacs.conversations.xml.Element;
|
||||||
import eu.siacs.conversations.xmpp.OnIqPacketReceived;
|
import eu.siacs.conversations.xmpp.OnIqPacketReceived;
|
||||||
import eu.siacs.conversations.xmpp.jingle.stanzas.Content;
|
import eu.siacs.conversations.xmpp.jingle.stanzas.Content;
|
||||||
|
@ -244,8 +244,7 @@ public class JingleConnection {
|
||||||
Element fileNameElement = fileOffer.findChild("name");
|
Element fileNameElement = fileOffer.findChild("name");
|
||||||
if (fileNameElement!=null) {
|
if (fileNameElement!=null) {
|
||||||
boolean supportedFile = false;
|
boolean supportedFile = false;
|
||||||
Log.d("xmppService","file offer: "+fileNameElement.getContent());
|
String[] filename = fileNameElement.getContent().toLowerCase(Locale.US).split("\\.");
|
||||||
String[] filename = fileNameElement.getContent().toLowerCase().split("\\.");
|
|
||||||
if (Arrays.asList(this.extensions).contains(filename[filename.length - 1])) {
|
if (Arrays.asList(this.extensions).contains(filename[filename.length - 1])) {
|
||||||
supportedFile = true;
|
supportedFile = true;
|
||||||
} else if (Arrays.asList(this.cryptoExtensions).contains(filename[filename.length - 1])) {
|
} else if (Arrays.asList(this.cryptoExtensions).contains(filename[filename.length - 1])) {
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
package eu.siacs.conversations.xmpp.jingle;
|
package eu.siacs.conversations.xmpp.jingle;
|
||||||
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.ObjectInputStream.GetField;
|
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
|
|
Loading…
Reference in a new issue