aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-08-26 10:19:59 +0200
committerChristian Schneppe <christian@pix-art.de>2016-08-26 22:39:14 +0200
commit019dd0a23dd53c5760fda0c88a094c34ad946357 (patch)
tree4e9db30610e3d057ef30d2f4187c60b37cce621a /src/main
parent2b79b43075e5ead799c560236086f1f3b598b17d (diff)
add snackbar for request presence subscription
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java15
-rw-r--r--src/main/res/values/strings.xml2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index 66b901ae3..b89e8351c 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -829,6 +829,19 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
};
+ private OnClickListener mAllowPresenceSubscription = new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ final Contact contact = conversation == null ? null : conversation.getContact();
+ if (contact != null) {
+ activity.xmppConnectionService.sendPresencePacket(contact.getAccount(),
+ activity.xmppConnectionService.getPresenceGenerator()
+ .sendPresenceUpdatesTo(contact));
+ hideSnackbar();
+ }
+ }
+ };
+
private OnClickListener mAnswerSmpClickListener = new OnClickListener() {
@Override
public void onClick(View view) {
@@ -851,6 +864,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
showSnackbar(R.string.contact_blocked, R.string.unblock, this.mUnblockClickListener);
} else if (!contact.showInRoster() && contact.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) {
showSnackbar(R.string.contact_added_you, R.string.add_back, this.mAddBackClickListener);
+ } else if (contact.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) {
+ showSnackbar(R.string.contact_asks_for_presence_subscription, R.string.allow, this.mAllowPresenceSubscription);
} else if (mode == Conversation.MODE_MULTI
&& !conversation.getMucOptions().online()
&& account.getStatus() == Account.State.ONLINE) {
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 01a8ddb1b..93c287159 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -688,4 +688,6 @@
<string name="payment_required">Payment required</string>
<string name="missing_internet_permission">Missing internet permission</string>
<string name="me">Me</string>
+ <string name="contact_asks_for_presence_subscription">Contact asks for presence subscription</string>
+ <string name="allow">Allow</string>
</resources>