removed dead code + null check
This commit is contained in:
parent
b0db88c405
commit
678fcf8b31
|
@ -94,13 +94,6 @@ public class MessageGenerator extends AbstractGenerator {
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addMessageHints(MessagePacket packet) {
|
|
||||||
packet.addChild("private", "urn:xmpp:carbons:2");
|
|
||||||
packet.addChild("no-copy", "urn:xmpp:hints");
|
|
||||||
packet.addChild("no-permanent-store", "urn:xmpp:hints");
|
|
||||||
packet.addChild("no-permanent-storage", "urn:xmpp:hints"); //do not copy this. this is wrong. it is *store*
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagePacket generateChat(Message message) {
|
public MessagePacket generateChat(Message message) {
|
||||||
MessagePacket packet = preparePacket(message);
|
MessagePacket packet = preparePacket(message);
|
||||||
String content;
|
String content;
|
||||||
|
|
|
@ -919,7 +919,7 @@ public class XmppConnectionService extends Service {
|
||||||
public boolean hasInternetConnection() {
|
public boolean hasInternetConnection() {
|
||||||
final ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
final ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
try {
|
try {
|
||||||
final NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
final NetworkInfo activeNetwork = cm == null ? null : cm.getActiveNetworkInfo();
|
||||||
return activeNetwork != null && activeNetwork.isConnected();
|
return activeNetwork != null && activeNetwork.isConnected();
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
Log.d(Config.LOGTAG, "unable to check for internet connection", e);
|
Log.d(Config.LOGTAG, "unable to check for internet connection", e);
|
||||||
|
|
Loading…
Reference in New Issue