diff options
author | lookshe <github@lookshe.org> | 2016-04-05 23:35:38 +0200 |
---|---|---|
committer | lookshe <github@lookshe.org> | 2016-04-05 23:35:38 +0200 |
commit | 0beb3ca30b31f07e374b870e6a659256f6960170 (patch) | |
tree | 82a389561691afa508433d338e3f87aa6c8a5c7b /src/main/java/de/thedevstack/conversationsplus/services | |
parent | 6899b9b01e416da95b9006d9f23bf1e1214f607d (diff) | |
parent | d6a076e11281d4c3fb6b9504fe99d799b04ebbbb (diff) |
Merge branch 'trz/rebase' into trz/rename
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/services')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/services/XmppConnectionService.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/services/XmppConnectionService.java b/src/main/java/de/thedevstack/conversationsplus/services/XmppConnectionService.java index 6e07f49c..d92401ba 100644 --- a/src/main/java/de/thedevstack/conversationsplus/services/XmppConnectionService.java +++ b/src/main/java/de/thedevstack/conversationsplus/services/XmppConnectionService.java @@ -818,8 +818,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa private void sendFileMessage(final Message message, final boolean delay) { Logging.d(Config.LOGTAG, "send file message"); final Account account = message.getConversation().getAccount(); - final XmppConnection connection = account.getXmppConnection(); - if (connection != null && connection.getFeatures().httpUpload()) { + if (account.httpUploadAvailable(FileBackend.getFile(message,false).getSize())) { mHttpConnectionManager.createNewUploadConnection(message, delay); } else { mJingleConnectionManager.createNewConnection(message); @@ -856,7 +855,8 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa switch (message.getEncryption()) { case Message.ENCRYPTION_NONE: if (message.needsUploading()) { - if (account.httpUploadAvailable() || message.fixCounterpart()) { + if (account.httpUploadAvailable(FileBackend.getFile(message,false).getSize()) + || message.fixCounterpart()) { this.sendFileMessage(message, delay); } else { break; @@ -868,7 +868,8 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa case Message.ENCRYPTION_PGP: case Message.ENCRYPTION_DECRYPTED: if (message.needsUploading()) { - if (account.httpUploadAvailable() || message.fixCounterpart()) { + if (account.httpUploadAvailable(FileBackend.getFile(message,false).getSize()) + || message.fixCounterpart()) { this.sendFileMessage(message, delay); } else { break; @@ -902,9 +903,10 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa } break; case Message.ENCRYPTION_AXOLOTL: - message.setAxolotlFingerprint(account.getAxolotlService().getOwnFingerprint()); + message.setFingerprint(account.getAxolotlService().getOwnFingerprint()); if (message.needsUploading()) { - if (account.httpUploadAvailable() || message.fixCounterpart()) { + if (account.httpUploadAvailable(FileBackend.getFile(message,false).getSize()) + || message.fixCounterpart()) { this.sendFileMessage(message, delay); } else { break; @@ -948,7 +950,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa } break; case Message.ENCRYPTION_AXOLOTL: - message.setAxolotlFingerprint(account.getAxolotlService().getOwnFingerprint()); + message.setFingerprint(account.getAxolotlService().getOwnFingerprint()); break; } } @@ -2564,9 +2566,9 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa if (unreadCount != count) { Logging.d(Config.LOGTAG, "update unread count to " + count); if (count > 0) { - ShortcutBadger.with(getApplicationContext()).count(count); + ShortcutBadger.applyCount(getApplicationContext(), count); } else { - ShortcutBadger.with(getApplicationContext()).remove(); + ShortcutBadger.removeCount(getApplicationContext()); } unreadCount = count; } |