-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
30 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Copyright (C) 2018-2021 Chupligin Serhey <[email protected]> | ||
/* Copyright (C) 2018-2023 Chupligin Serhey <[email protected]> | ||
* Copyright (C) 2012 John Brooks <[email protected]> | ||
* Copyright (C) 2011 Robin Burchell <[email protected]> | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Copyright (C) 2018 Chupligin Serhey <[email protected]> | ||
/* Copyright (C) 2018-2023 Chupligin Serhey <[email protected]> | ||
* Copyright (C) 2012 John Brooks <[email protected]> | ||
* Copyright (C) 2011 Robin Burchell <[email protected]> | ||
* | ||
|
@@ -54,9 +54,7 @@ Item { | |
|
||
delegate: ConversationListDelegate { | ||
onClicked: { | ||
var group = model.group | ||
var channel = channelManager.getConversation(group.localUid, group.remoteUids[0]) | ||
pageStack.push(Qt.resolvedUrl("../pages/ConversationPage.qml"), { "channel": channel, "group": group }) | ||
app.push(Qt.resolvedUrl("../pages/ConversationPage.qml"), { "group": model.group }) | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Copyright (C) 2018-2021 Chupligin Sergey <[email protected]> | ||
/* Copyright (C) 2018-2023 Chupligin Sergey <[email protected]> | ||
* Copyright (C) 2012 John Brooks <[email protected]> | ||
* | ||
* You may use this file under the terms of the BSD license as follows: | ||
|
@@ -35,6 +35,8 @@ import QtQuick.Controls | |
import Nemo | ||
import Nemo.Controls | ||
|
||
import org.nemomobile.commhistory 1.0 | ||
|
||
Item { | ||
property alias model: view.model | ||
// The event model is in descending order, but we need to display ascending. | ||
|
@@ -51,12 +53,12 @@ Item { | |
|
||
Connections { | ||
target: model || null | ||
onRowsInserted: { | ||
function onRowsInserted(first, last) { | ||
if (first === 0) { | ||
view.positionViewAtBeginning() | ||
} | ||
} | ||
onModelReset: view.positionViewAtBeginning() | ||
function onModelReset() { view.positionViewAtBeginning() } | ||
} | ||
|
||
delegate: Item{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Copyright (C) 2018-2021 Chupligin Sergey <[email protected]> | ||
/* Copyright (C) 2018-2023 Chupligin Sergey <[email protected]> | ||
* Copyright (C) 2012 John Brooks <[email protected]> | ||
* Copyright (C) 2011 Robin Burchell <[email protected]> | ||
* | ||
|
@@ -47,7 +47,6 @@ import "../components" | |
Page { | ||
id: conversationPage | ||
|
||
property QtObject channel: null | ||
property QtObject group | ||
property QtObject person: group ? peopleModel.personById(group.contactId) : null | ||
property string remoteUid: "" | ||
|
@@ -75,7 +74,6 @@ Page { | |
|
||
TextField { | ||
id: targetEditor | ||
visible: !channel | ||
width: parent.width-Theme.itemSpacingLarge*2 | ||
height: Theme.itemHeightExtraLarge-Theme.itemSpacingLarge*2 | ||
|
||
|
@@ -119,65 +117,30 @@ Page { | |
width: parent.width | ||
|
||
onSendMessage: { | ||
if (text.length < 1 && (!channel && targetEditor.length < 1)) { | ||
if (text.length < 1 && (targetEditor.length < 1)) { | ||
return | ||
} | ||
|
||
if(!channel) { | ||
channel = channelManager.getConversation(accountsModel.get(0, TelepathyAccountsModel.AccountUidRole),targetEditor.text) | ||
hTools.title = targetEditor.text | ||
} | ||
|
||
groupManager.createOutgoingMessageEvent(group.id, channel.localUid, group.remoteUids[0], text, function(eventId) { | ||
groupManager.createOutgoingMessageEvent(group.id, group.localUid, group.remoteUids[0], text, function(eventId) { | ||
console.log("groupId" + group.id) | ||
console.log("channel.localUid" + channel.localUid) | ||
console.log("group.localUid" + group.localUid) | ||
console.log("group.remoteUids[0]" + group.remoteUids[0]) | ||
console.log("eventId" + eventId) | ||
channel.sendMessage(text, eventId) | ||
}) | ||
clear() | ||
} | ||
} | ||
|
||
states: [ | ||
State { | ||
name: "new" | ||
when: channel == null | ||
|
||
PropertyChanges { | ||
target: targetEditor | ||
visible: true | ||
} | ||
|
||
AnchorChanges { | ||
target: messagesView | ||
anchors.top: targetEditor.bottom | ||
} | ||
} | ||
] | ||
|
||
onChannelChanged: { | ||
if (channel != null) { | ||
channel.ensureChannel() | ||
_updateGroup() | ||
} | ||
} | ||
|
||
Connections { | ||
target: groupManager | ||
|
||
function onGroupAdded(){ _updateGroup() } | ||
function onGroupUpdated() { _updateGroup() } | ||
} | ||
|
||
Connections { | ||
target: Qt.application | ||
onActiveChanged: markAsRead() | ||
} | ||
|
||
function _updateGroup() { | ||
if (group === null) | ||
group = groupManager.findGroup(channel.localUid, channel.remoteUid) | ||
group = groupManager.findGroup(group.localUid, group.remoteUid) | ||
} | ||
|
||
function markAsRead() { | ||
|