diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-10-26 19:31:19 +0200 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-10-26 19:31:19 +0200 |
commit | 8e2adfcfd1def2a348e8ac8410e4430c0d13c76a (patch) | |
tree | 85f34687451ef6ae44a43797458375cbc4077851 | |
parent | aac524da7efb35f7bf7269b56457cf40d63d14d1 (diff) |
fix some issues
3 files changed, 32 insertions, 25 deletions
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java index e64615f31..07da9ad54 100644 --- a/src/main/java/de/pixart/messenger/services/NotificationService.java +++ b/src/main/java/de/pixart/messenger/services/NotificationService.java @@ -17,6 +17,11 @@ import android.net.Uri; import android.os.Build; import android.os.SystemClock; import android.preference.PreferenceManager; +import android.text.SpannableString; +import android.text.style.StyleSpan; +import android.util.DisplayMetrics; +import android.util.Log; + import androidx.annotation.RequiresApi; import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationCompat.BigPictureStyle; @@ -26,10 +31,6 @@ import androidx.core.app.Person; import androidx.core.app.RemoteInput; import androidx.core.content.ContextCompat; import androidx.core.graphics.drawable.IconCompat; -import android.text.SpannableString; -import android.text.style.StyleSpan; -import android.util.DisplayMetrics; -import android.util.Log; import java.io.File; import java.io.IOException; @@ -918,32 +919,32 @@ public class NotificationService { enabled++; } } - } - if (accounts.size() == 1) { - mAccount = accounts.get(0); - if (mAccount.getStatus() == Account.State.ONLINE) { - status = "(" + mXmppConnectionService.getString(R.string.account_status_online) + ")"; - status = " " + status; - Log.d(Config.LOGTAG, "Status: " + status); - mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.conversations_foreground_service) + status); - } else if (mAccount.getStatus() == Account.State.CONNECTING) { - status = "(" + mXmppConnectionService.getString(R.string.account_status_connecting) + ")"; - status = " " + status; - Log.d(Config.LOGTAG, "Status: " + status); - mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.conversations_foreground_service) + status); + if (accounts.size() == 1) { + mAccount = accounts.get(0); + if (mAccount.getStatus() == Account.State.ONLINE) { + status = "(" + mXmppConnectionService.getString(R.string.account_status_online) + ")"; + status = " " + status; + Log.d(Config.LOGTAG, "Status: " + status); + mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.conversations_foreground_service) + status); + } else if (mAccount.getStatus() == Account.State.CONNECTING) { + status = "(" + mXmppConnectionService.getString(R.string.account_status_connecting) + ")"; + status = " " + status; + Log.d(Config.LOGTAG, "Status: " + status); + mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.conversations_foreground_service) + status); + } else { + status = "(" + mXmppConnectionService.getString(R.string.account_status_offline) + ")"; + status = " " + status; + Log.d(Config.LOGTAG, "Status: " + status); + mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.conversations_foreground_service) + status); + } + } else if (accounts.size() > 1) { + mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.conversations_foreground_service)); } else { status = "(" + mXmppConnectionService.getString(R.string.account_status_offline) + ")"; status = " " + status; Log.d(Config.LOGTAG, "Status: " + status); mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.conversations_foreground_service) + status); } - } else if (accounts.size() > 1) { - mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.conversations_foreground_service)); - } else { - status = "(" + mXmppConnectionService.getString(R.string.account_status_offline) + ")"; - status = " " + status; - Log.d(Config.LOGTAG, "Status: " + status); - mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.conversations_foreground_service) + status); } mBuilder.setContentText(mXmppConnectionService.getString(R.string.connected_accounts, connected, enabled)); mBuilder.setContentIntent(createOpenConversationsIntent()); diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 9edb147e7..b63588718 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -778,6 +778,12 @@ public class XmppConnectionService extends Service { } if (pingNow) { for (Account account : pingCandidates) { + List<Conversation> conversations = getConversations(); + for (Conversation conversation : conversations) { + if (conversation.getAccount() == account && !account.pendingConferenceJoins.contains(conversation)) { + resendFailedFileMessages(conversation); + } + } final boolean lowTimeout = isInLowPingTimeoutMode(account); account.getXmppConnection().sendPing(); Log.d(Config.LOGTAG, account.getJid().asBareJid() + " send ping (action=" + action + ",lowTimeout=" + Boolean.toString(lowTimeout) + ")"); diff --git a/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java b/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java index bab53e127..8d2c88c1b 100644 --- a/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java @@ -169,7 +169,7 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O } @Override - public void onChannelSearchResultsFound(List<MuclumbusService.Room> results) { + public void onChannelSearchResultsFound(final List<MuclumbusService.Room> results) { runOnUiThread(() -> { if (results.size() > 0) { adapter.submitList(results); |