parent
579ca265b4
commit
0ae1881564
|
@ -424,6 +424,8 @@ QtObject:
|
|||
contact.removed = false
|
||||
self.saveContact(contact)
|
||||
self.events.emit(SIGNAL_CONTACT_ADDED, ContactArgs(contactId: contact.id))
|
||||
self.activityCenterService.parseActivityCenterResponse(response)
|
||||
|
||||
except Exception as e:
|
||||
error "an error occurred while sending contact request", msg=e.msg
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@ Item {
|
|||
color: {
|
||||
if (root.accepted) {
|
||||
return Theme.palette.successColor1
|
||||
} else if (root.pending) {
|
||||
return Theme.palette.baseColor1
|
||||
} else if (root.dismissed) {
|
||||
return Theme.palette.dangerColor1
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ ActivityNotificationMessage {
|
|||
readonly property bool dismissed: notification && notification.message.contactRequestState === Constants.contactRequestStateDismissed
|
||||
|
||||
Connections {
|
||||
target: root.isOutgoingRequest ? root.store.contactsStore.sentContactRequestsModel :
|
||||
target: root.isOutgoingMessage ? root.store.contactsStore.sentContactRequestsModel :
|
||||
root.store.contactsStore.receivedContactRequestsModel
|
||||
|
||||
function onItemChanged(pubKey) {
|
||||
|
@ -30,34 +30,20 @@ ActivityNotificationMessage {
|
|||
}
|
||||
|
||||
maximumLineCount: 5
|
||||
messageDetails.messageText: {
|
||||
if (isOutgoingRequest && contactDetails) {
|
||||
const status = accepted ? qsTr("accepted") : dismissed ? qsTr("dismissed") : qsTr("recieved")
|
||||
return qsTr("%1 %2 your contact request").arg(contactDetails.displayName).arg(status)
|
||||
}
|
||||
messageDetails.messageText: !root.isOutgoingMessage && notification ? notification.message.messageText : ""
|
||||
|
||||
if (!isOutgoingRequest && notification) {
|
||||
return notification.message.messageText
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
messageSubheaderComponent: !isOutgoingRequest ? subheaderComponent : null
|
||||
|
||||
Component {
|
||||
id: subheaderComponent
|
||||
|
||||
StatusBaseText {
|
||||
text: qsTr("Sent contact request:")
|
||||
color: Theme.palette.baseColor1
|
||||
messageSubheaderComponent: StatusBaseText {
|
||||
text: root.isOutgoingMessage ? qsTr("Сontact request sent to %1").arg(contactName) :
|
||||
qsTr("Сontact request:")
|
||||
font.italic: true
|
||||
font.pixelSize: 15
|
||||
}
|
||||
maximumLineCount: 2
|
||||
wrapMode: Text.WordWrap
|
||||
color: Theme.palette.baseColor1
|
||||
}
|
||||
|
||||
ctaComponent: ContactRequestCta {
|
||||
isOutgoingRequest: root.isOutgoingRequest
|
||||
isOutgoingRequest: root.isOutgoingMessage
|
||||
pending: root.pending
|
||||
accepted: root.accepted
|
||||
dismissed: root.dismissed
|
||||
|
|
|
@ -16,7 +16,7 @@ ActivityNotificationMessage {
|
|||
id: root
|
||||
|
||||
Connections {
|
||||
target: root.isOutgoingRequest ? root.store.contactsStore.sentContactRequestsModel :
|
||||
target: root.isOutgoingMessage ? root.store.contactsStore.sentContactRequestsModel :
|
||||
root.store.contactsStore.receivedContactRequestsModel
|
||||
|
||||
function onItemChanged(pubKey) {
|
||||
|
@ -29,7 +29,7 @@ ActivityNotificationMessage {
|
|||
if (!notification)
|
||||
return ""
|
||||
|
||||
return root.isOutgoingRequest ? notification.repliedMessage.messageText : notification.message.messageText
|
||||
return root.isOutgoingMessage ? notification.repliedMessage.messageText : notification.message.messageText
|
||||
}
|
||||
|
||||
messageSubheaderComponent: StatusBaseText {
|
||||
|
@ -37,7 +37,7 @@ ActivityNotificationMessage {
|
|||
if (!notification)
|
||||
return ""
|
||||
|
||||
if (root.isOutgoingRequest) {
|
||||
if (root.isOutgoingMessage) {
|
||||
return qsTr("To verify their identity you asked: %1").arg(CoreUtils.Utils.stripHtmlTags(notification.message.messageText))
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ ActivityNotificationMessage {
|
|||
font.pixelSize: 15
|
||||
}
|
||||
|
||||
ctaComponent: isOutgoingRequest ? outgoingContactVerificationCta : incomingContactVerificationCta
|
||||
ctaComponent: isOutgoingMessage ? outgoingContactVerificationCta : incomingContactVerificationCta
|
||||
|
||||
Component {
|
||||
id: outgoingContactVerificationCta
|
||||
|
|
|
@ -12,8 +12,10 @@ import utils 1.0
|
|||
ActivityNotificationBase {
|
||||
id: root
|
||||
|
||||
readonly property bool isOutgoingRequest: notification && notification.message.amISender
|
||||
readonly property string contactId: notification ? isOutgoingRequest ? notification.chatId : notification.author : ""
|
||||
readonly property bool isOutgoingMessage: notification && notification.message.amISender
|
||||
readonly property string contactId: notification ? isOutgoingMessage ? notification.chatId : notification.author : ""
|
||||
readonly property string contactName: contactDetails ? ProfileUtils.displayName(contactDetails.localNickname, contactDetails.name,
|
||||
contactDetails.displayName, contactDetails.alias) : ""
|
||||
|
||||
property var contactDetails: null
|
||||
property int maximumLineCount: 2
|
||||
|
@ -24,8 +26,7 @@ ActivityNotificationBase {
|
|||
messageText: notification ? notification.message.messageText : ""
|
||||
amISender: false
|
||||
sender.id: contactId
|
||||
sender.displayName: contactDetails ? ProfileUtils.displayName(contactDetails.localNickname, contactDetails.name,
|
||||
contactDetails.displayName, contactDetails.alias) : ""
|
||||
sender.displayName: contactName
|
||||
sender.secondaryName: contactDetails && contactDetails.localNickname ?
|
||||
ProfileUtils.displayName("", contactDetails.name, contactDetails.displayName, contactDetails.alias) : ""
|
||||
sender.trustIndicator: contactDetails ? contactDetails.trustStatus : Constants.trustStatus.unknown
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit dd7c59423f125f7e40b7423e56ae03fe8cfba6a8
|
||||
Subproject commit 96532f97c460f849ed8b1ed5d2507593e3ca5c1c
|
Loading…
Reference in New Issue