Merge pull request #1569 from nextcloud/bugfix/1567/hide-own-conversation-in-forward-to-selection-screen

Hide own conversation in "forward to" selection screen
This commit is contained in:
Marcel Hibbe 2021-09-02 13:34:59 +02:00 committed by GitHub
commit 139df41ac5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View file

@ -2170,6 +2170,7 @@ class ChatController(args: Bundle) :
val bundle = Bundle()
bundle.putBoolean(BundleKeys.KEY_FORWARD_MSG_FLAG, true)
bundle.putString(BundleKeys.KEY_FORWARD_MSG_TEXT, message?.text)
bundle.putString(BundleKeys.KEY_FORWARD_HIDE_SOURCE_ROOM, roomId)
getRouter().pushController(
RouterTransaction.with(ConversationsListController(bundle))
.pushChangeHandler(HorizontalChangeHandler())

View file

@ -488,6 +488,12 @@ public class ConversationsListController extends BaseController implements Searc
Conversation conversation;
for (int i = 0; i < roomsOverall.getOcs().getData().size(); i++) {
conversation = roomsOverall.getOcs().getData().get(i);
if (bundle.containsKey(BundleKeys.INSTANCE.getKEY_FORWARD_HIDE_SOURCE_ROOM()) && conversation.roomId.equals(bundle.getString(
BundleKeys.INSTANCE.getKEY_FORWARD_HIDE_SOURCE_ROOM()))) {
continue;
}
if (shouldUseLastMessageLayout) {
if (getActivity() != null) {
ConversationItem conversationItem = new ConversationItem(conversation

View file

@ -70,4 +70,5 @@ object BundleKeys {
val KEY_META_DATA = "KEY_META_DATA"
val KEY_FORWARD_MSG_FLAG = "KEY_FORWARD_MSG_FLAG"
val KEY_FORWARD_MSG_TEXT = "KEY_FORWARD_MSG_TEXT"
val KEY_FORWARD_HIDE_SOURCE_ROOM = "KEY_FORWARD_HIDE_SOURCE_ROOM"
}