Hide own conversation in "forward to" selection screen

Resolves #1567

Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
Tim Krüger 2021-09-02 11:57:27 +02:00
parent f297705985
commit 730c85811e
No known key found for this signature in database
GPG key ID: FECE3A7222C52A4E
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"
}