2019-03-22 14:28:14 +11:00
|
|
|
import QtQuick 2.7
|
2019-05-03 04:20:21 +10:00
|
|
|
import QtQuick.Layouts 1.3
|
2019-04-29 05:18:36 +10:00
|
|
|
import "../Base"
|
2019-04-29 04:34:29 +10:00
|
|
|
import "Banners"
|
|
|
|
import "RoomEventList"
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-04-29 05:18:36 +10:00
|
|
|
HColumnLayout {
|
2019-04-22 00:44:04 +10:00
|
|
|
property string userId: ""
|
2019-05-03 04:20:21 +10:00
|
|
|
property string category: ""
|
2019-04-22 00:44:04 +10:00
|
|
|
property string roomId: ""
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-04-22 00:44:04 +10:00
|
|
|
readonly property var roomInfo:
|
2019-05-03 04:31:47 +10:00
|
|
|
Backend.accounts.get(userId)
|
|
|
|
.roomCategories.get(category)
|
|
|
|
.rooms.get(roomId)
|
2019-04-15 06:12:07 +10:00
|
|
|
|
2019-04-21 07:45:51 +10:00
|
|
|
id: chatPage
|
2019-03-22 14:28:14 +11:00
|
|
|
onFocusChanged: sendBox.setFocus()
|
|
|
|
|
2019-05-07 04:06:28 +10:00
|
|
|
Component.onCompleted: Backend.signals.roomCategoryChanged.connect(
|
|
|
|
function(forUserId, forRoomId, previous, now) {
|
|
|
|
if (chatPage && forUserId == userId && forRoomId == roomId) {
|
|
|
|
chatPage.category = now
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2019-04-21 07:36:21 +10:00
|
|
|
RoomHeader {
|
|
|
|
displayName: roomInfo.displayName
|
2019-04-30 13:51:37 +10:00
|
|
|
topic: roomInfo.topic || ""
|
2019-04-21 07:36:21 +10:00
|
|
|
}
|
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
RoomEventList {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
2019-04-22 00:44:04 +10:00
|
|
|
|
2019-04-15 06:12:07 +10:00
|
|
|
TypingUsersBar {}
|
2019-04-22 00:44:04 +10:00
|
|
|
|
2019-04-22 05:20:20 +10:00
|
|
|
InviteBanner {
|
2019-05-03 04:20:21 +10:00
|
|
|
visible: category === "Invites"
|
2019-04-22 01:15:03 +10:00
|
|
|
inviter: roomInfo.inviter
|
2019-04-22 00:44:04 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
SendBox {
|
|
|
|
id: sendBox
|
2019-05-03 04:20:21 +10:00
|
|
|
visible: category === "Rooms"
|
2019-04-22 05:20:20 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
LeftBanner {
|
2019-05-03 04:20:21 +10:00
|
|
|
visible: category === "Left"
|
2019-04-22 05:20:20 +10:00
|
|
|
leftEvent: roomInfo.leftEvent
|
2019-04-22 00:44:04 +10:00
|
|
|
}
|
2019-03-22 14:28:14 +11:00
|
|
|
}
|