aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-06-02 20:36:44 +0200
committerChristian Schneppe <christian@pix-art.de>2016-06-02 20:36:44 +0200
commit4ce93a69e95b1c0661cc406a5d0dd530cc2fe5cb (patch)
tree1d201aec806c8e9f873fd0e71680a1ceb8696f9e /src
parent997ae90b46577652141bfcea5190957543f0ff7f (diff)
Share link to invite user to start over with Pix-Art Messenger
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/Config.java2
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java2
-rw-r--r--src/main/java/eu/siacs/conversations/ui/XmppActivity.java16
-rw-r--r--src/main/res/menu/conversations.xml6
-rw-r--r--src/main/res/values-de/strings.xml3
-rw-r--r--src/main/res/values/strings.xml17
6 files changed, 39 insertions, 7 deletions
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java
index afb6a358a..bbfedb22a 100644
--- a/src/main/java/eu/siacs/conversations/Config.java
+++ b/src/main/java/eu/siacs/conversations/Config.java
@@ -42,6 +42,8 @@ public final class Config {
public static final String BUG_REPORTS = "bugs@pix-art.de";
+ public static String inviteUserURL = "https://jabber.pix-art.de/i/";
+
public static final String DOMAIN_LOCK = "pix-art.de"; //only allow account creation for this domain
public static final String MAGIC_CREATE_DOMAIN = "pix-art.de";
public static final boolean SINGLE_ACCOUNT = true; //set to true to allow only one account
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 398ca0a1d..4d9aa8d6c 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -551,6 +551,7 @@ public class ConversationActivity extends XmppActivity
final MenuItem menuMute = menu.findItem(R.id.action_mute);
final MenuItem menuUnmute = menu.findItem(R.id.action_unmute);
final MenuItem menuUpdater = menu.findItem(R.id.action_check_updates);
+ final MenuItem menuInviteUser = menu.findItem(R.id.action_invite_user);
if (isConversationsOverviewVisable() && isConversationsOverviewHideable()) {
menuArchiveChat.setVisible(false);
@@ -565,6 +566,7 @@ public class ConversationActivity extends XmppActivity
menuAdd.setVisible(!isConversationsOverviewHideable());
//hide settings, accounts and updater in all menus except in main window
menuUpdater.setVisible(false);
+ menuInviteUser.setVisible(false);
if (this.getSelectedConversation() != null) {
if (this.getSelectedConversation().getMode() == Conversation.MODE_SINGLE) {
diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
index 0cefe1d2d..ad1cbf905 100644
--- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
@@ -359,6 +359,9 @@ public abstract class XmppActivity extends Activity {
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
+ case R.id.action_invite_user:
+ inviteUser();
+ break;
case R.id.action_settings:
startActivity(new Intent(this, SettingsActivity.class));
break;
@@ -1076,6 +1079,19 @@ public abstract class XmppActivity extends Activity {
return null;
}
+ private void inviteUser() {
+ Account mAccount = xmppConnectionService.getAccounts().get(0);
+ String user = mAccount.getJid().getLocalpart().toString();
+ String domain = mAccount.getJid().getDomainpart().toString();
+ String inviteURL = Config.inviteUserURL + user + "/" + domain;
+ String inviteText = getString(R.string.InviteText, user);
+ Intent intent = new Intent(android.content.Intent.ACTION_SEND);
+ intent.setType("text/plain");
+ intent.putExtra(Intent.EXTRA_SUBJECT, user + " " + getString(R.string.inviteUser_Subject) + " " + getString(R.string.app_name));
+ intent.putExtra(Intent.EXTRA_TEXT, inviteText + "\n\n" + inviteURL);
+ startActivity(Intent.createChooser(intent, getString(R.string.invite_contact)));
+ }
+
@Override
public void onResume() {
super.onResume();
diff --git a/src/main/res/menu/conversations.xml b/src/main/res/menu/conversations.xml
index de13d9a42..a75abb05a 100644
--- a/src/main/res/menu/conversations.xml
+++ b/src/main/res/menu/conversations.xml
@@ -74,6 +74,12 @@
android:showAsAction="never"
android:title="@string/action_settings"/>
<item
+ android:id="@+id/action_invite_user"
+ android:orderInCategory="100"
+ android:showAsAction="always"
+ android:title="@string/invite_contact"
+ android:icon="@drawable/ic_share_white_24dp"/>
+ <item
android:id="@+id/action_check_updates"
android:orderInCategory="100"
android:showAsAction="never"
diff --git a/src/main/res/values-de/strings.xml b/src/main/res/values-de/strings.xml
index e9e8d95b2..e216b4b1a 100644
--- a/src/main/res/values-de/strings.xml
+++ b/src/main/res/values-de/strings.xml
@@ -613,5 +613,8 @@
<string name="import_database">Backup importieren</string>
<string name="import_text">Es wurde ein Backup gefunden, welches importiert werden kann.\nMöglicherweise wirst du gefragt, ob du eine ältere Version oder Conversations deinstallieren möchtest und dein Messenger startet während des Importvorgangs neu. Soll das Backup importiert werden?</string>
<string name="uninstall_app_text">Es ist eine alte Version von Pix-Art Messenger oder Conversations installiert. Falls du einen alten Pix-Art Messenger installiert hast, solltest du diesen deinstallieren. Nach der Deinstallation, solltest du erneut auf \'Backup importieren\' klicken, damit deine Daten in die neue Version importiert werden.</string>
+ <string name="InviteText">Hallo,\n\n%s hat dich zu einem Gespräch mit Pix-Art Messenger eingeladen. Falls du Android Nutzer bist, probiere es aus und klicke folgenden Link...</string>
+ <string name="inviteUser_Subject">hat dich eingeladen über</string>
+ <string name="invite_again">Erneut einladen</string>
</resources>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index b465b4b92..cbebb77c7 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -273,11 +273,9 @@
<string name="pref_expert_options_summary">Please be careful with these</string>
<string name="title_activity_about">About Pix-Art Messenger</string>
<string name="pref_about_conversations_summary">Build and licensing information</string>
- <string name="pref_about_message" translatable="false">Pix-Art Messenger is a fork of Conversations.
- \n\nConversations • the very last word in instant messaging.
- \n\nCopyright © 2014-2016 Daniel Gultsch
- \n\nModified by Christian Schneppe
- \n\nhttp://xmpp.pix-art.de
+ <string name="pref_about_message" translatable="false">Pix-Art Messenger
+ \n\nCopyright © 2014-2016 Christian Schneppe
+ \n\nhttp://jabber.pix-art.de
\n\nThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
@@ -288,8 +286,8 @@
GNU General Public License for more details.
\n\nYou should have received a copy of the GNU General Public License
along with this program. If not, see https://www.gnu.org/licenses
- \n\nDownload the full original source code at https://github.com/siacs/Conversations
- \n\nDownload the forked and modified source code at https://github.com/kriztan/Pix-Art-Messenger
+ \n\nDownload the full original source code at https://github.com/siacs/Conversations (Copyright © 2014-2016 Daniel Gultsch)
+ \n\nDownload the modified source code at https://github.com/kriztan/Pix-Art-Messenger
\n\n\nLibraries
\n\nhttps://www.bouncycastle.org\n(The MIT License (MIT))
\n\nhttps://www.gnu.org/software/libidn\n(Apache License, Version 2.0)
@@ -310,6 +308,9 @@
\n\nhttps://github.com/google/gson\n(Apache License, Version 2.0)
\n\nhttp://hc.apache.org/httpcomponents-client\n(Apache License, Version 2.0)
\n\nhttp://hc.apache.org/httpcomponents-core\n(Apache License, Version 2.0)
+ \n\nhttps://github.com/bumptech/glide\n(BSD, The MIT License (MIT) and Apache License, Version 2.0)
+ \n\nhttps://github.com/chrisbanes/PhotoView\n(Apache License, Version 2.0)
+ \n\nhttps://github.com/rtoshiro/FullscreenVideoView\n(Apache License, Version 2.0)
</string>
<string name="title_pref_quiet_hours">Quiet Hours</string>
<string name="title_pref_quiet_hours_start_time">Start time</string>
@@ -647,4 +648,6 @@
<string name="uninstall_app_text">There is an old version of Pix-Art Messenger or Conversations installed. If you have an old Pix-Art Messenger installed, you should uninstall this version. After uninstalled the old versoin, you should choose \'import backup\' again and we will import your data to the new version.</string>
<string name="you">You</string>
<string name="invite_again">Invite again</string>
+ <string name="inviteUser_Subject">has invited you via</string>
+ <string name="InviteText">Hello,\n\nthe user %s has invited you to Pix-Art Messenger. If you are using Android, give it a try and click the following link to start over...</string>
</resources>