Group name changing and member adding/removing implemented.

This commit is contained in:
B. Petersen
2017-01-13 01:09:13 +01:00
parent e2a4008742
commit 18a8e2358c
5 changed files with 27 additions and 2 deletions
@@ -204,6 +204,7 @@ public class MrMailbox {
public final static int MR_EVENT_MSG_DELIVERED = 3000;
public final static int MR_EVENT_MSG_READ = 3010;
public final static int MR_EVENT_CONNECTION_STATE_CHANGED = 3020;
public final static int MR_EVENT_CHAT_MODIFIED = 3030;
public static long MrCallback(final int event, final long data1, final long data2) // this function is called from within the C-wrapper
{
switch(event) {
@@ -253,6 +254,18 @@ public class MrMailbox {
}
});
return 0;
case MR_EVENT_CHAT_MODIFIED:
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
reloadMainChatlist();
NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces,
MessagesController.UPDATE_MASK_NAME|MessagesController.UPDATE_MASK_CHAT_NAME|
MessagesController.UPDATE_MASK_CHAT_MEMBERS|MessagesController.UPDATE_MASK_AVATAR);
}
});
return 0;
}
return 0;
}
@@ -302,6 +315,10 @@ public class MrMailbox {
MrStockAddStr(12, LocaleController.getString("AttachDocument", R.string.AttachDocument));
MrStockAddStr(13, LocaleController.getString("DefaultStatusText", R.string.DefaultStatusText));
MrStockAddStr(14, LocaleController.getString("MsgNewGroupDraft", R.string.MsgNewGroupDraft));
MrStockAddStr(15, LocaleController.getString("MsgGroupNameChanged", R.string.MsgGroupNameChanged));
MrStockAddStr(16, LocaleController.getString("MsgGroupImageChanged", R.string.MsgGroupImageChanged));
MrStockAddStr(17, LocaleController.getString("MsgMemberAddedToGroup", R.string.MsgMemberAddedToGroup));
MrStockAddStr(18, LocaleController.getString("MsgMemberRemovedFromToGroup", R.string.MsgMemberRemovedFromToGroup));
}
public static String getInviteText() {
@@ -636,7 +636,7 @@ public class NotificationsSettingsActivity extends BaseFragment implements Notif
value = preferences.getString("GroupSound", LocaleController.getString("SoundDefault", R.string.SoundDefault));
}
if (value.equals("NoSound")) {
value = LocaleController.getString("NoSound", R.string.NoSound);
value = LocaleController.getString("Disabled", R.string.Disabled);
}
textCell.setTextAndValue(LocaleController.getString("Sound", R.string.Sound), value, true);
} else if (i == messageVibrateRow || i == groupVibrateRow) {
@@ -600,7 +600,7 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
} else if (i == settingsSoundRow) {
String value = preferences.getString("sound_" + dialog_id, LocaleController.getString("SoundDefault", R.string.SoundDefault));
if (value.equals("NoSound")) {
value = LocaleController.getString("NoSound", R.string.NoSound);
value = LocaleController.getString("Disabled", R.string.Disabled);
}
textCell.setTextAndValue(LocaleController.getString("Sound", R.string.Sound), value, true);
} else if (i == settingsPriorityRow) {