ActivityNotification: unnecessary code removed

This commit is contained in:
Michał Cieślak 2024-11-13 17:12:31 +01:00 committed by Michał
parent 109edbe7a1
commit ea584f0693
6 changed files with 2 additions and 61 deletions

View File

@ -677,29 +677,7 @@ QtObject {
//Update oneToOneChatContact when the contact is updated
readonly property var myContactsModelConnection: Connections {
target: root.contactsStore.myContactsModel ?? null
enabled: d.activeChatType === Constants.chatType.oneToOne
function onItemChanged(pubKey) {
if (pubKey === d.activeChatId) {
d.oneToOneChatContact = Utils.getContactDetailsAsJson(pubKey, false)
}
}
}
readonly property var receivedContactsReqModelConnection: Connections {
target: root.contactsStore.receivedContactRequestsModel ?? null
enabled: d.activeChatType === Constants.chatType.oneToOne
function onItemChanged(pubKey) {
if (pubKey === d.activeChatId) {
d.oneToOneChatContact = Utils.getContactDetailsAsJson(pubKey, false)
}
}
}
readonly property var sentContactReqModelConnection: Connections {
target: root.contactsStore.sentContactRequestsModel ?? null
target: root.contactsStore.contactsModel ?? null
enabled: d.activeChatType === Constants.chatType.oneToOne
function onItemChanged(pubKey) {

View File

@ -53,11 +53,7 @@ Item {
property bool stickersLoaded: false
property bool canPost: true
property var viewAndPostHoldingsModel
readonly property var contactDetails: rootStore ? rootStore.oneToOneChatContact : null
readonly property bool isUserAdded: !!root.contactDetails && root.contactDetails.isContactRequestSent
property bool amISectionAdmin: false
property bool sendViaPersonalChatEnabled
signal openStickerPackPopup(string stickerPackId)

View File

@ -45,8 +45,6 @@ QtObject {
readonly property bool isFirstShowcaseInteraction: localAccountSettings.isFirstShowcaseInteraction
property var details: Utils.getContactDetailsAsJson(pubkey)
// The following signals wrap the settings / preferences save request responses in one unique result (identity + preferences result)
signal profileSettingsSaveSucceeded()
signal profileSettingsSaveFailed()

View File

@ -17,27 +17,6 @@ import "../stores"
ActivityNotificationMessage {
id: root
function checkAndUpdateContactDetails(pubKey) {
if (pubKey === root.contactId)
root.updateContactDetails()
}
Connections {
target: root.store.contactsStore.sentContactRequestsModel
function onItemChanged(pubKey) {
root.checkAndUpdateContactDetails(pubKey)
}
}
Connections {
target: root.store.contactsStore.receivedContactRequestsModel
function onItemChanged(pubKey) {
root.checkAndUpdateContactDetails(pubKey)
}
}
messageSubheaderComponent: StatusBaseText {
text: qsTr("Removed you as a contact")
font.italic: true

View File

@ -22,16 +22,6 @@ ActivityNotificationMessage {
readonly property string contactRequestId: notification && notification.message ? notification.message.id : ""
Connections {
target: root.isOutgoingMessage ? root.store.contactsStore.sentContactRequestsModel :
root.store.contactsStore.receivedContactRequestsModel
function onItemChanged(pubKey) {
if (pubKey === root.contactId)
root.updateContactDetails()
}
}
maximumLineCount: 5
messageDetails.messageText: !root.isOutgoingMessage && notification ? notification.message.messageText : ""

View File

@ -62,7 +62,7 @@ ActivityNotificationBase {
onContactIdChanged: root.updateContactDetails()
Connections {
target: root.store.contactsStore.myContactsModel
target: root.store.contactsStore.contactsModel
function onItemChanged(pubKey) {
if (pubKey === root.contactId)