Add event log menu to profile activity

This commit is contained in:
NekoInverter 2020-04-10 20:56:31 +08:00
parent ad66247fbe
commit 8e94ff4b5b
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9
1 changed files with 6 additions and 0 deletions

View File

@ -258,6 +258,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
private final static int statistics = 19;
private final static int start_secret_chat = 20;
private final static int gallery_menu_save = 21;
private final static int event_log = 22;
private Rect rect = new Rect();
@ -1241,6 +1242,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
}
} else if (id == leave_group) {
leaveChatPressed();
} else if (id == event_log) {
presentFragment(new ChannelAdminLogActivity(currentChat));
} else if (id == edit_channel) {
Bundle args = new Bundle();
args.putInt("chat_id", chat_id);
@ -4372,6 +4375,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
otherItem.addSubItem(leave_group, R.drawable.msg_leave, LocaleController.getString("LeaveChannelMenu", R.string.LeaveChannelMenu));
}
}
if (ChatObject.hasAdminRights(currentChat)) {
otherItem.addSubItem(event_log, R.drawable.group_log, LocaleController.getString("EventLog", R.string.EventLog));
}
} else {
editItemVisible = true;
if (!ChatObject.isKickedFromChat(chat) && !ChatObject.isLeftFromChat(chat)) {