fix: join/decline group
This commit is contained in:
parent
d5f53765b3
commit
2fb8f2ea55
|
@ -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.}
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue