fix: join/decline group

This commit is contained in:
Richard Ramos 2020-09-18 09:11:51 -04:00 committed by Iuri Matias
parent d5f53765b3
commit 2fb8f2ea55
4 changed files with 18 additions and 0 deletions

View File

@ -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.}

View File

@ -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"

View File

@ -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

View File

@ -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;
}
}
}