mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Add invite function.
This commit is contained in:
@@ -290,4 +290,11 @@ public class MrMailbox {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static String getInviteText() {
|
||||
String url = "https://getdelta.org";
|
||||
String email = getConfig("addr", "");
|
||||
String text = LocaleController.formatString("InviteText", R.string.InviteText, url, email);
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,10 @@ public class DrawerLayoutAdapter extends BaseAdapter {
|
||||
public final static int iNewGroup = 3;
|
||||
public final static int iDivider = 4;
|
||||
public final static int iSettings = 5;
|
||||
public final static int iDeaddrop = 6;
|
||||
public final static int iFaq = 7;
|
||||
public final static int iCount = 8;
|
||||
public final static int iInviteFriends = 6;
|
||||
public final static int iDeaddrop = 7;
|
||||
public final static int iFaq = 8;
|
||||
public final static int iCount = 9;
|
||||
|
||||
public final static int typeProfile = 0;
|
||||
public final static int typeEmpty = 1;
|
||||
@@ -103,6 +104,8 @@ public class DrawerLayoutAdapter extends BaseAdapter {
|
||||
actionCell.setTextAndIcon(LocaleController.getString("NewChat", R.string.NewChat), R.drawable.menu_newchat);
|
||||
} else if (i == iNewGroup) {
|
||||
actionCell.setTextAndIcon(LocaleController.getString("NewGroup", R.string.NewGroup), R.drawable.menu_empty);
|
||||
} else if (i == iInviteFriends) {
|
||||
actionCell.setTextAndIcon(LocaleController.getString("InviteFriends", R.string.InviteFriends), R.drawable.menu_empty);
|
||||
} else if (i == iDeaddrop) {
|
||||
actionCell.setTextAndIcon(LocaleController.getString("Deaddrop", R.string.Deaddrop), R.drawable.menu_empty);
|
||||
// we do not want an icon beside the mailbox:
|
||||
|
||||
@@ -309,6 +309,17 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||
presentFragment(new ContactsActivity(args));
|
||||
drawerLayoutContainer.closeDrawer(false);
|
||||
}
|
||||
else if (position == DrawerLayoutAdapter.iInviteFriends) {
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||
intent.setType("text/plain");
|
||||
intent.putExtra(Intent.EXTRA_TEXT, MrMailbox.getInviteText());
|
||||
startActivityForResult(Intent.createChooser(intent, LocaleController.getString("InviteFriends", R.string.InviteFriends)), 500);
|
||||
} catch (Exception e) {
|
||||
FileLog.e("tmessages", e);
|
||||
}
|
||||
drawerLayoutContainer.closeDrawer(false);
|
||||
}
|
||||
else if (position == DrawerLayoutAdapter.iDeaddrop) {
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("chat_id", MrChat.MR_CHAT_ID_DEADDROP);
|
||||
|
||||
Reference in New Issue
Block a user