Port RoomManager to C++
This also makes it possible to handle the Matrix URI
This commit is contained in:
@@ -116,16 +116,15 @@ Kirigami.ScrollablePage {
|
||||
action: Kirigami.Action {
|
||||
id: enterRoomAction
|
||||
onTriggered: {
|
||||
var roomItem = roomManager.enterRoom(currentRoom)
|
||||
roomListItem.KeyNavigation.right = roomItem
|
||||
roomItem.focus = true;
|
||||
itemSelection.setCurrentIndex(sortFilterRoomListModel.mapToSource(sortFilterRoomListModel.index(index, 0)), ItemSelectionModel.SelectCurrent)
|
||||
RoomManager.enterRoom(currentRoom);
|
||||
itemSelection.setCurrentIndex(sortFilterRoomListModel.mapToSource(
|
||||
sortFilterRoomListModel.index(index, 0)), ItemSelectionModel.SelectCurrent)
|
||||
}
|
||||
}
|
||||
bold: unreadCount > 0
|
||||
label: name ?? ""
|
||||
subtitle: {
|
||||
let txt = (lastEvent == "" ? topic : lastEvent).replace(/(\r\n\t|\n|\r\t)/gm," ")
|
||||
let txt = (lastEvent.length === 0 ? topic : lastEvent).replace(/(\r\n\t|\n|\r\t)/gm, " ")
|
||||
if (txt.length) {
|
||||
return txt
|
||||
}
|
||||
|
||||
@@ -21,7 +21,8 @@ import NeoChat.Menu.Timeline 1.0
|
||||
Kirigami.ScrollablePage {
|
||||
id: page
|
||||
|
||||
required property var currentRoom
|
||||
/// It's not readonly because of the seperate window view.
|
||||
property var currentRoom: RoomManager.currentRoom
|
||||
|
||||
title: currentRoom.displayName
|
||||
|
||||
@@ -30,19 +31,17 @@ Kirigami.ScrollablePage {
|
||||
|
||||
onCurrentRoomChanged: ChatBoxHelper.clearEditReply()
|
||||
|
||||
|
||||
ActionsHandler {
|
||||
id: actionsHandler
|
||||
room: page.currentRoom
|
||||
connection: Controller.activeConnection
|
||||
}
|
||||
|
||||
|
||||
Connections {
|
||||
target: Controller.activeConnection
|
||||
function onJoinedRoom(room) {
|
||||
if(room.id === invitation.id) {
|
||||
roomManager.enterRoom(room);
|
||||
RoomManager.enterRoom(room);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,7 +80,7 @@ Kirigami.ScrollablePage {
|
||||
|
||||
onClicked: {
|
||||
page.currentRoom.forget()
|
||||
roomManager.getBack();
|
||||
RoomManager.getBack();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -667,6 +666,11 @@ Kirigami.ScrollablePage {
|
||||
FullScreenImage {}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: userDetailDialog
|
||||
|
||||
UserDetailDialog {}
|
||||
}
|
||||
|
||||
header: TypingPane {
|
||||
id: typingPane
|
||||
@@ -746,6 +750,20 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function warning(title, message) {
|
||||
page.header.contentItem.text = `${title}<br />${message}`;
|
||||
page.header.contentItem.type = Kirigami.MessageType.Warning;
|
||||
page.header.contentItem.visible = true;
|
||||
}
|
||||
|
||||
function showUserDetail(user) {
|
||||
userDetailDialog.createObject(QQC2.ApplicationWindow.overlay, {
|
||||
room: currentRoom,
|
||||
user: user,
|
||||
}).open();
|
||||
}
|
||||
|
||||
function goToLastMessage() {
|
||||
currentRoom.markAllMessagesAsRead()
|
||||
// scroll to the very end, i.e to messageListView.YEnd
|
||||
|
||||
Reference in New Issue
Block a user