diff --git a/src/app/chat/view.nim b/src/app/chat/view.nim index 0c2f9506eb..1dad3ad25a 100644 --- a/src/app/chat/view.nim +++ b/src/app/chat/view.nim @@ -411,8 +411,11 @@ QtObject: self.status.chat.join(channel, ChatType(chatTypeInt)) self.setActiveChannel(channel) + proc chatGroupJoined(self: ChatsView) {.signal.} + proc joinGroup*(self: ChatsView) {.slot.} = self.status.chat.confirmJoiningGroup(self.activeChannel.id) + self.chatGroupJoined() proc messagesLoaded*(self: ChatsView) {.signal.} diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml index d4ae20fe5b..8daa4668cc 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml @@ -20,6 +20,13 @@ Rectangle { property bool paste: false; property bool isColonPressed: false; + Connections { + target: chatsModel + onChatGroupJoined: { + rectangle.visible = true; + } + } + Audio { id: sendMessageSound source: "../../../../sounds/send_message.wav" diff --git a/ui/app/AppLayouts/Chat/ChatColumn/Message.qml b/ui/app/AppLayouts/Chat/ChatColumn/Message.qml index 9be54c714e..22f825520a 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/Message.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/Message.qml @@ -110,6 +110,11 @@ Item { Component { id: fetchMoreMessagesButtonComponent Item { + visible: { + if(chatsModel.activeChannel.chatType !== Constants.chatTypePrivateGroupChat) return true; + return chatsModel.activeChannel.isMember(profileModel.profile.pubKey) + } + id: wrapper height: wrapper.visible ? fetchMoreButton.height + fetchDate.height + 3 + Style.current.smallPadding*2 : 0 anchors.left: parent.left diff --git a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChannelIdentifier.qml b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChannelIdentifier.qml index b510c4a101..2999f861e5 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChannelIdentifier.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChannelIdentifier.qml @@ -101,6 +101,8 @@ Item { visible: chatsModel.activeChannel.chatType === Constants.chatTypePrivateGroupChat && !chatsModel.activeChannel.isMember(profileModel.profile.pubKey) anchors.top: channelDescription.bottom anchors.topMargin: 16 + anchors.horizontalCenter: parent.horizontalCenter + height: visible ? 100 : 10 id: joinOrDecline StyledText { @@ -116,6 +118,7 @@ Item { anchors.fill: parent onClicked: { chatsModel.joinGroup() + joinOrDecline.visible = false; } } }