feat(privacy): reimplement show only contact pfp using status-go setting
Fixes #4900
This commit is contained in:
parent
63d56aba12
commit
68a4498d11
|
@ -56,8 +56,6 @@ const LSS_KEY_FONT_SIZE* = "fontSize"
|
||||||
const DEFAULT_FONT_SIZE = 2 #fontSizeM from qml
|
const DEFAULT_FONT_SIZE = 2 #fontSizeM from qml
|
||||||
const LSS_KEY_HIDE_SIGN_PHRASE_MODAL* = "hideSignPhraseModal"
|
const LSS_KEY_HIDE_SIGN_PHRASE_MODAL* = "hideSignPhraseModal"
|
||||||
const DEFAULT_HIDE_SIGN_PHRASE_MODAL = false
|
const DEFAULT_HIDE_SIGN_PHRASE_MODAL = false
|
||||||
const LSS_KEY_ONLY_SHOW_CONTACTS_PICS* = "onlyShowContactsProfilePics"
|
|
||||||
const DEFAULT_ONLY_SHOW_CONTACTS_PICS = true
|
|
||||||
const LSS_KEY_QUITE_ON_CLOSE* = "quitOnClose"
|
const LSS_KEY_QUITE_ON_CLOSE* = "quitOnClose"
|
||||||
const DEFAULT_QUITE_ON_CLOSE = false
|
const DEFAULT_QUITE_ON_CLOSE = false
|
||||||
const LSS_KEY_SKIN_COLOR* = "skinColor"
|
const LSS_KEY_SKIN_COLOR* = "skinColor"
|
||||||
|
@ -522,19 +520,6 @@ QtObject:
|
||||||
notify = hideSignPhraseModalChanged
|
notify = hideSignPhraseModalChanged
|
||||||
|
|
||||||
|
|
||||||
proc onlyShowContactsProfilePicsChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
|
||||||
proc getOnlyShowContactsProfilePics*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
|
||||||
getSettingsProp[bool](self, LSS_KEY_ONLY_SHOW_CONTACTS_PICS, newQVariant(DEFAULT_ONLY_SHOW_CONTACTS_PICS))
|
|
||||||
proc setOnlyShowContactsProfilePics*(self: LocalAccountSensitiveSettings, value: bool) {.slot.} =
|
|
||||||
setSettingsProp(self, LSS_KEY_ONLY_SHOW_CONTACTS_PICS, newQVariant(value)):
|
|
||||||
self.onlyShowContactsProfilePicsChanged()
|
|
||||||
|
|
||||||
QtProperty[bool] onlyShowContactsProfilePics:
|
|
||||||
read = getOnlyShowContactsProfilePics
|
|
||||||
write = setOnlyShowContactsProfilePics
|
|
||||||
notify = onlyShowContactsProfilePicsChanged
|
|
||||||
|
|
||||||
|
|
||||||
proc quitOnCloseChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
proc quitOnCloseChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||||
proc getQuitOnClose*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
proc getQuitOnClose*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
||||||
getSettingsProp[bool](self, LSS_KEY_QUITE_ON_CLOSE, newQVariant(DEFAULT_QUITE_ON_CLOSE))
|
getSettingsProp[bool](self, LSS_KEY_QUITE_ON_CLOSE, newQVariant(DEFAULT_QUITE_ON_CLOSE))
|
||||||
|
@ -856,7 +841,6 @@ QtObject:
|
||||||
of LSS_KEY_HIDE_CHANNEL_SUGGESTIONS: self.hideChannelSuggestionsChanged()
|
of LSS_KEY_HIDE_CHANNEL_SUGGESTIONS: self.hideChannelSuggestionsChanged()
|
||||||
of LSS_KEY_FONT_SIZE: self.fontSizeChanged()
|
of LSS_KEY_FONT_SIZE: self.fontSizeChanged()
|
||||||
of LSS_KEY_HIDE_SIGN_PHRASE_MODAL: self.hideSignPhraseModalChanged()
|
of LSS_KEY_HIDE_SIGN_PHRASE_MODAL: self.hideSignPhraseModalChanged()
|
||||||
of LSS_KEY_ONLY_SHOW_CONTACTS_PICS: self.onlyShowContactsProfilePicsChanged()
|
|
||||||
of LSS_KEY_QUITE_ON_CLOSE: self.quitOnCloseChanged()
|
of LSS_KEY_QUITE_ON_CLOSE: self.quitOnCloseChanged()
|
||||||
of LSS_KEY_SKIN_COLOR: self.skinColorChanged()
|
of LSS_KEY_SKIN_COLOR: self.skinColorChanged()
|
||||||
of LSS_KEY_SHOW_DELETE_MESSAGE_WARNING: self.showDeleteMessageWarningChanged()
|
of LSS_KEY_SHOW_DELETE_MESSAGE_WARNING: self.showDeleteMessageWarningChanged()
|
||||||
|
|
|
@ -80,8 +80,10 @@ method convertToItems*[T](
|
||||||
contactDetails.displayName,
|
contactDetails.displayName,
|
||||||
contactDetails.details.localNickname,
|
contactDetails.details.localNickname,
|
||||||
contactDetails.icon,
|
contactDetails.icon,
|
||||||
|
contactDetails.details.identicon,
|
||||||
contactDetails.isIdenticon,
|
contactDetails.isIdenticon,
|
||||||
contactDetails.isCurrentUser,
|
contactDetails.isCurrentUser,
|
||||||
|
contactDetails.details.added,
|
||||||
n.message.outgoingStatus,
|
n.message.outgoingStatus,
|
||||||
self.controller.getRenderedText(n.message.parsedText),
|
self.controller.getRenderedText(n.message.parsedText),
|
||||||
n.message.image,
|
n.message.image,
|
||||||
|
|
|
@ -118,6 +118,18 @@ method init*(self: Controller) =
|
||||||
var args = ContactArgs(e)
|
var args = ContactArgs(e)
|
||||||
self.delegate.updateContactDetails(args.contactId)
|
self.delegate.updateContactDetails(args.contactId)
|
||||||
|
|
||||||
|
self.events.on(SIGNAL_CONTACT_ADDED) do(e: Args):
|
||||||
|
var args = ContactArgs(e)
|
||||||
|
self.delegate.updateContactDetails(args.contactId)
|
||||||
|
|
||||||
|
self.events.on(SIGNAL_CONTACT_REMOVED) do(e: Args):
|
||||||
|
var args = ContactArgs(e)
|
||||||
|
self.delegate.updateContactDetails(args.contactId)
|
||||||
|
|
||||||
|
self.events.on(SIGNAL_CONTACT_BLOCKED) do(e: Args):
|
||||||
|
var args = ContactArgs(e)
|
||||||
|
self.delegate.updateContactDetails(args.contactId)
|
||||||
|
|
||||||
self.events.on(SIGNAL_LOGGEDIN_USER_IMAGE_CHANGED) do(e: Args):
|
self.events.on(SIGNAL_LOGGEDIN_USER_IMAGE_CHANGED) do(e: Args):
|
||||||
self.delegate.updateContactDetails(singletonInstance.userProfile.getPubKey())
|
self.delegate.updateContactDetails(singletonInstance.userProfile.getPubKey())
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,6 @@ method getModuleAsVariant*(self: Module): QVariant =
|
||||||
|
|
||||||
proc createFetchMoreMessagesItem(self: Module): Item =
|
proc createFetchMoreMessagesItem(self: Module): Item =
|
||||||
let chatDto = self.controller.getChatDetails()
|
let chatDto = self.controller.getChatDetails()
|
||||||
let isIdenticon = false
|
|
||||||
result = initItem(
|
result = initItem(
|
||||||
FETCH_MORE_MESSAGES_MESSAGE_ID,
|
FETCH_MORE_MESSAGES_MESSAGE_ID,
|
||||||
communityId = "",
|
communityId = "",
|
||||||
|
@ -79,8 +78,10 @@ proc createFetchMoreMessagesItem(self: Module): Item =
|
||||||
senderDisplayName = "",
|
senderDisplayName = "",
|
||||||
senderLocalName = "",
|
senderLocalName = "",
|
||||||
senderIcon = "",
|
senderIcon = "",
|
||||||
isIdenticon,
|
senderIdenticon = "",
|
||||||
|
isSenderIconIdenticon = false,
|
||||||
amISender = false,
|
amISender = false,
|
||||||
|
senderIsAdded = false,
|
||||||
outgoingStatus = "",
|
outgoingStatus = "",
|
||||||
text = "",
|
text = "",
|
||||||
image = "",
|
image = "",
|
||||||
|
@ -100,7 +101,10 @@ proc createChatIdentifierItem(self: Module): Item =
|
||||||
var chatName = chatDto.name
|
var chatName = chatDto.name
|
||||||
var chatIcon = chatDto.identicon
|
var chatIcon = chatDto.identicon
|
||||||
var isIdenticon = false
|
var isIdenticon = false
|
||||||
|
var senderIsAdded = false
|
||||||
if(chatDto.chatType == ChatType.OneToOne):
|
if(chatDto.chatType == ChatType.OneToOne):
|
||||||
|
let sender = self.controller.getContactDetails(chatDto.id)
|
||||||
|
senderIsAdded = sender.details.added
|
||||||
(chatName, chatIcon, isIdenticon) = self.controller.getOneToOneChatNameAndImage()
|
(chatName, chatIcon, isIdenticon) = self.controller.getOneToOneChatNameAndImage()
|
||||||
|
|
||||||
result = initItem(
|
result = initItem(
|
||||||
|
@ -111,8 +115,10 @@ proc createChatIdentifierItem(self: Module): Item =
|
||||||
senderDisplayName = chatName,
|
senderDisplayName = chatName,
|
||||||
senderLocalName = "",
|
senderLocalName = "",
|
||||||
senderIcon = chatIcon,
|
senderIcon = chatIcon,
|
||||||
|
chatDto.identicon,
|
||||||
isIdenticon,
|
isIdenticon,
|
||||||
amISender = false,
|
amISender = false,
|
||||||
|
senderIsAdded,
|
||||||
outgoingStatus = "",
|
outgoingStatus = "",
|
||||||
text = "",
|
text = "",
|
||||||
image = "",
|
image = "",
|
||||||
|
@ -173,8 +179,10 @@ method newMessagesLoaded*(self: Module, messages: seq[MessageDto], reactions: se
|
||||||
sender.displayName,
|
sender.displayName,
|
||||||
sender.details.localNickname,
|
sender.details.localNickname,
|
||||||
sender.icon,
|
sender.icon,
|
||||||
|
sender.details.identicon,
|
||||||
sender.isIdenticon,
|
sender.isIdenticon,
|
||||||
isCurrentUser,
|
isCurrentUser,
|
||||||
|
sender.details.added,
|
||||||
m.outgoingStatus,
|
m.outgoingStatus,
|
||||||
renderedMessageText,
|
renderedMessageText,
|
||||||
m.image,
|
m.image,
|
||||||
|
@ -259,8 +267,10 @@ method messageAdded*(self: Module, message: MessageDto) =
|
||||||
sender.displayName,
|
sender.displayName,
|
||||||
sender.details.localNickname,
|
sender.details.localNickname,
|
||||||
sender.icon,
|
sender.icon,
|
||||||
|
sender.details.identicon,
|
||||||
sender.isIdenticon,
|
sender.isIdenticon,
|
||||||
isCurrentUser,
|
isCurrentUser,
|
||||||
|
sender.details.added,
|
||||||
message.outgoingStatus,
|
message.outgoingStatus,
|
||||||
renderedMessageText,
|
renderedMessageText,
|
||||||
message.image,
|
message.image,
|
||||||
|
@ -386,6 +396,7 @@ method updateContactDetails*(self: Module, contactId: string) =
|
||||||
item.senderLocalName = updatedContact.details.localNickname
|
item.senderLocalName = updatedContact.details.localNickname
|
||||||
item.senderIcon = updatedContact.icon
|
item.senderIcon = updatedContact.icon
|
||||||
item.isSenderIconIdenticon = updatedContact.isIdenticon
|
item.isSenderIconIdenticon = updatedContact.isIdenticon
|
||||||
|
item.senderIsAdded = updatedContact.details.added
|
||||||
if(item.messageContainsMentions):
|
if(item.messageContainsMentions):
|
||||||
let (m, _, err) = self.controller.getMessageDetails(item.id)
|
let (m, _, err) = self.controller.getMessageDetails(item.id)
|
||||||
if(err.len == 0):
|
if(err.len == 0):
|
||||||
|
|
|
@ -163,8 +163,10 @@ proc buildPinnedMessageItem(self: Module, messageId: string, actionInitiatedBy:
|
||||||
contactDetails.displayName,
|
contactDetails.displayName,
|
||||||
contactDetails.details.localNickname,
|
contactDetails.details.localNickname,
|
||||||
contactDetails.icon,
|
contactDetails.icon,
|
||||||
|
contactDetails.details.identicon,
|
||||||
contactDetails.isIdenticon,
|
contactDetails.isIdenticon,
|
||||||
isCurrentUser,
|
isCurrentUser,
|
||||||
|
contactDetails.details.added,
|
||||||
m.outgoingStatus,
|
m.outgoingStatus,
|
||||||
self.controller.getRenderedText(m.parsedText),
|
self.controller.getRenderedText(m.parsedText),
|
||||||
m.image,
|
m.image,
|
||||||
|
|
|
@ -87,6 +87,18 @@ method init*(self: Controller) =
|
||||||
let args = ContactArgs(e)
|
let args = ContactArgs(e)
|
||||||
self.delegate.contactUpdated(args.contactId)
|
self.delegate.contactUpdated(args.contactId)
|
||||||
|
|
||||||
|
self.events.on(SIGNAL_CONTACT_ADDED) do(e: Args):
|
||||||
|
let args = ContactArgs(e)
|
||||||
|
self.delegate.contactUpdated(args.contactId)
|
||||||
|
|
||||||
|
self.events.on(SIGNAL_CONTACT_REMOVED) do(e: Args):
|
||||||
|
let args = ContactArgs(e)
|
||||||
|
self.delegate.contactUpdated(args.contactId)
|
||||||
|
|
||||||
|
self.events.on(SIGNAL_CONTACT_BLOCKED) do(e: Args):
|
||||||
|
let args = ContactArgs(e)
|
||||||
|
self.delegate.contactUpdated(args.contactId)
|
||||||
|
|
||||||
self.events.on(SIGNAL_LOGGEDIN_USER_IMAGE_CHANGED) do(e: Args):
|
self.events.on(SIGNAL_LOGGEDIN_USER_IMAGE_CHANGED) do(e: Args):
|
||||||
self.delegate.loggedInUserImageChanged()
|
self.delegate.loggedInUserImageChanged()
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,9 @@ method viewDidLoad*(self: Module) =
|
||||||
alias = singletonInstance.userProfile.getUsername(),
|
alias = singletonInstance.userProfile.getUsername(),
|
||||||
OnlineStatus.Online,
|
OnlineStatus.Online,
|
||||||
singletonInstance.userProfile.getIcon(),
|
singletonInstance.userProfile.getIcon(),
|
||||||
|
singletonInstance.userProfile.getIdenticon(),
|
||||||
singletonInstance.userProfile.getIsIdenticon(),
|
singletonInstance.userProfile.getIsIdenticon(),
|
||||||
|
isAdded = true,
|
||||||
admin,
|
admin,
|
||||||
joined,
|
joined,
|
||||||
))
|
))
|
||||||
|
@ -83,7 +85,9 @@ method viewDidLoad*(self: Module) =
|
||||||
contactDetails.details.alias,
|
contactDetails.details.alias,
|
||||||
status,
|
status,
|
||||||
contactDetails.icon,
|
contactDetails.icon,
|
||||||
|
contactDetails.details.identicon,
|
||||||
contactDetails.isidenticon,
|
contactDetails.isidenticon,
|
||||||
|
contactDetails.details.added,
|
||||||
admin,
|
admin,
|
||||||
joined
|
joined
|
||||||
))
|
))
|
||||||
|
@ -114,7 +118,9 @@ method newMessagesLoaded*(self: Module, messages: seq[MessageDto]) =
|
||||||
contactDetails.details.alias,
|
contactDetails.details.alias,
|
||||||
status,
|
status,
|
||||||
contactDetails.icon,
|
contactDetails.icon,
|
||||||
|
contactDetails.details.identicon,
|
||||||
contactDetails.isidenticon,
|
contactDetails.isidenticon,
|
||||||
|
contactDetails.details.added,
|
||||||
))
|
))
|
||||||
|
|
||||||
method contactNicknameChanged*(self: Module, publicKey: string) =
|
method contactNicknameChanged*(self: Module, publicKey: string) =
|
||||||
|
@ -141,6 +147,7 @@ method contactUpdated*(self: Module, publicKey: string) =
|
||||||
contactDetails.details.alias,
|
contactDetails.details.alias,
|
||||||
contactDetails.icon,
|
contactDetails.icon,
|
||||||
contactDetails.isidenticon,
|
contactDetails.isidenticon,
|
||||||
|
contactDetails.details.added,
|
||||||
)
|
)
|
||||||
|
|
||||||
method loggedInUserImageChanged*(self: Module) =
|
method loggedInUserImageChanged*(self: Module) =
|
||||||
|
@ -164,7 +171,9 @@ method onChatMembersAdded*(self: Module, ids: seq[string]) =
|
||||||
contactDetails.details.alias,
|
contactDetails.details.alias,
|
||||||
status,
|
status,
|
||||||
contactDetails.icon,
|
contactDetails.icon,
|
||||||
|
contactDetails.details.identicon,
|
||||||
contactDetails.isidenticon,
|
contactDetails.isidenticon,
|
||||||
|
contactDetails.details.added,
|
||||||
admin,
|
admin,
|
||||||
joined
|
joined
|
||||||
))
|
))
|
||||||
|
@ -182,6 +191,7 @@ method onChatMemberUpdated*(self: Module, publicKey: string, admin: bool, joined
|
||||||
contactDetails.details.alias,
|
contactDetails.details.alias,
|
||||||
contactDetails.icon,
|
contactDetails.icon,
|
||||||
contactDetails.isidenticon,
|
contactDetails.isidenticon,
|
||||||
|
contactDetails.details.added,
|
||||||
admin,
|
admin,
|
||||||
joined)
|
joined)
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,9 @@ method getCommunityItem(self: Module, c: CommunityDto): SectionItem =
|
||||||
contactDetails.details.alias,
|
contactDetails.details.alias,
|
||||||
OnlineStatus.Offline, # TODO get the actual status?
|
OnlineStatus.Offline, # TODO get the actual status?
|
||||||
contactDetails.icon,
|
contactDetails.icon,
|
||||||
|
contactDetails.details.identicon,
|
||||||
contactDetails.isidenticon,
|
contactDetails.isidenticon,
|
||||||
|
contactDetails.details.added,
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,9 @@ proc createCommunityItem[T](self: Module[T], c: CommunityDto): SectionItem =
|
||||||
contactDetails.details.alias,
|
contactDetails.details.alias,
|
||||||
OnlineStatus.Offline,
|
OnlineStatus.Offline,
|
||||||
contactDetails.icon,
|
contactDetails.icon,
|
||||||
|
contactDetails.details.identicon,
|
||||||
contactDetails.isidenticon,
|
contactDetails.isidenticon,
|
||||||
|
contactDetails.details.added
|
||||||
)),
|
)),
|
||||||
c.pendingRequestsToJoin.map(x => pending_request_item.initItem(
|
c.pendingRequestsToJoin.map(x => pending_request_item.initItem(
|
||||||
x.id,
|
x.id,
|
||||||
|
|
|
@ -60,3 +60,15 @@ method setMessagesFromContactsOnly*(self: Controller, value: bool): bool =
|
||||||
|
|
||||||
method validatePassword*(self: Controller, password: string): bool =
|
method validatePassword*(self: Controller, password: string): bool =
|
||||||
return self.privacyService.validatePassword(password)
|
return self.privacyService.validatePassword(password)
|
||||||
|
|
||||||
|
method getProfilePicturesShowTo*(self: Controller): int =
|
||||||
|
self.settingsService.getProfilePicturesShowTo()
|
||||||
|
|
||||||
|
method setProfilePicturesShowTo*(self: Controller, value: int): bool =
|
||||||
|
self.settingsService.saveProfilePicturesShowTo(value)
|
||||||
|
|
||||||
|
method getProfilePicturesVisibility*(self: Controller): int =
|
||||||
|
self.settingsService.getProfilePicturesVisibility()
|
||||||
|
|
||||||
|
method setProfilePicturesVisibility*(self: Controller, value: int): bool =
|
||||||
|
self.settingsService.saveProfilePicturesVisibility(value)
|
||||||
|
|
|
@ -34,3 +34,15 @@ method setMessagesFromContactsOnly*(self: AccessInterface, value: bool): bool {.
|
||||||
|
|
||||||
method validatePassword*(self: AccessInterface, password: string): bool {.base.} =
|
method validatePassword*(self: AccessInterface, password: string): bool {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method getProfilePicturesShowTo*(self: AccessInterface): int {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method setProfilePicturesShowTo*(self: AccessInterface, value: int): bool {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method getProfilePicturesVisibility*(self: AccessInterface): int {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method setProfilePicturesVisibility*(self: AccessInterface, value: int): bool {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -55,3 +55,15 @@ method setMessagesFromContactsOnly*(self: AccessInterface, value: bool) {.base.}
|
||||||
|
|
||||||
method validatePassword*(self: AccessInterface, password: string): bool {.base.} =
|
method validatePassword*(self: AccessInterface, password: string): bool {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method getProfilePicturesShowTo*(self: AccessInterface): int {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method setProfilePicturesShowTo*(self: AccessInterface, value: int) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method getProfilePicturesVisibility*(self: AccessInterface): int {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method setProfilePicturesVisibility*(self: AccessInterface, value: int) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -78,3 +78,17 @@ method setMessagesFromContactsOnly*(self: Module, value: bool) =
|
||||||
|
|
||||||
method validatePassword*(self: Module, password: string): bool =
|
method validatePassword*(self: Module, password: string): bool =
|
||||||
self.controller.validatePassword(password)
|
self.controller.validatePassword(password)
|
||||||
|
|
||||||
|
method getProfilePicturesShowTo*(self: Module): int =
|
||||||
|
self.controller.getProfilePicturesShowTo()
|
||||||
|
|
||||||
|
method setProfilePicturesShowTo*(self: Module, value: int) =
|
||||||
|
if (self.controller.setProfilePicturesShowTo(value)):
|
||||||
|
self.view.profilePicturesShowToChanged()
|
||||||
|
|
||||||
|
method getProfilePicturesVisibility*(self: Module): int =
|
||||||
|
self.controller.getProfilePicturesVisibility()
|
||||||
|
|
||||||
|
method setProfilePicturesVisibility*(self: Module, value: int) =
|
||||||
|
if (self.controller.setProfilePicturesVisibility(value)):
|
||||||
|
self.view.profilePicturesVisibilityChanged()
|
||||||
|
|
|
@ -60,3 +60,23 @@ QtObject:
|
||||||
|
|
||||||
proc validatePassword*(self: View, password: string): bool {.slot.} =
|
proc validatePassword*(self: View, password: string): bool {.slot.} =
|
||||||
self.delegate.validatePassword(password)
|
self.delegate.validatePassword(password)
|
||||||
|
|
||||||
|
proc profilePicturesShowToChanged*(self: View) {.signal.}
|
||||||
|
proc getProfilePicturesShowTo*(self: View): int {.slot.} =
|
||||||
|
return self.delegate.getProfilePicturesShowTo()
|
||||||
|
QtProperty[int] profilePicturesShowTo:
|
||||||
|
read = getProfilePicturesShowTo
|
||||||
|
notify = profilePicturesShowToChanged
|
||||||
|
|
||||||
|
proc setProfilePicturesShowTo*(self: View, value: int) {.slot.} =
|
||||||
|
self.delegate.setProfilePicturesShowTo(value)
|
||||||
|
|
||||||
|
proc profilePicturesVisibilityChanged*(self: View) {.signal.}
|
||||||
|
proc getProfilePicturesVisibility*(self: View): int {.slot.} =
|
||||||
|
return self.delegate.getProfilePicturesVisibility()
|
||||||
|
QtProperty[int] profilePicturesVisibility:
|
||||||
|
read = getProfilePicturesVisibility
|
||||||
|
notify = profilePicturesVisibilityChanged
|
||||||
|
|
||||||
|
proc setProfilePicturesVisibility*(self: View, value: int) {.slot.} =
|
||||||
|
self.delegate.setProfilePicturesVisibility(value)
|
||||||
|
|
|
@ -13,7 +13,9 @@ type
|
||||||
senderDisplayName: string
|
senderDisplayName: string
|
||||||
senderLocalName: string
|
senderLocalName: string
|
||||||
amISender: bool
|
amISender: bool
|
||||||
|
senderIsAdded: bool
|
||||||
senderIcon: string
|
senderIcon: string
|
||||||
|
senderIdenticon: string
|
||||||
isSenderIconIdenticon: bool
|
isSenderIconIdenticon: bool
|
||||||
seen: bool
|
seen: bool
|
||||||
outgoingStatus: string
|
outgoingStatus: string
|
||||||
|
@ -42,9 +44,11 @@ proc initItem*(
|
||||||
senderId,
|
senderId,
|
||||||
senderDisplayName,
|
senderDisplayName,
|
||||||
senderLocalName,
|
senderLocalName,
|
||||||
senderIcon: string,
|
senderIcon,
|
||||||
|
senderIdenticon: string,
|
||||||
isSenderIconIdenticon,
|
isSenderIconIdenticon,
|
||||||
amISender: bool,
|
amISender: bool,
|
||||||
|
senderIsAdded: bool,
|
||||||
outgoingStatus,
|
outgoingStatus,
|
||||||
text,
|
text,
|
||||||
image: string,
|
image: string,
|
||||||
|
@ -66,7 +70,9 @@ proc initItem*(
|
||||||
result.senderDisplayName = senderDisplayName
|
result.senderDisplayName = senderDisplayName
|
||||||
result.senderLocalName = senderLocalName
|
result.senderLocalName = senderLocalName
|
||||||
result.amISender = amISender
|
result.amISender = amISender
|
||||||
|
result.senderIsAdded = senderIsAdded
|
||||||
result.senderIcon = senderIcon
|
result.senderIcon = senderIcon
|
||||||
|
result.senderIdenticon = senderIdenticon
|
||||||
result.isSenderIconIdenticon = isSenderIconIdenticon
|
result.isSenderIconIdenticon = isSenderIconIdenticon
|
||||||
result.seen = seen
|
result.seen = seen
|
||||||
result.outgoingStatus = outgoingStatus
|
result.outgoingStatus = outgoingStatus
|
||||||
|
@ -96,6 +102,7 @@ proc `$`*(self: Item): string =
|
||||||
senderDisplayName: {$self.senderDisplayName},
|
senderDisplayName: {$self.senderDisplayName},
|
||||||
senderLocalName: {self.senderLocalName},
|
senderLocalName: {self.senderLocalName},
|
||||||
amISender: {$self.amISender},
|
amISender: {$self.amISender},
|
||||||
|
senderIsAdded: {$self.senderIsAdded},
|
||||||
isSenderIconIdenticon: {$self.isSenderIconIdenticon},
|
isSenderIconIdenticon: {$self.isSenderIconIdenticon},
|
||||||
seen: {$self.seen},
|
seen: {$self.seen},
|
||||||
outgoingStatus:{$self.outgoingStatus},
|
outgoingStatus:{$self.outgoingStatus},
|
||||||
|
@ -143,6 +150,9 @@ proc senderIcon*(self: Item): string {.inline.} =
|
||||||
proc `senderIcon=`*(self: Item, value: string) {.inline.} =
|
proc `senderIcon=`*(self: Item, value: string) {.inline.} =
|
||||||
self.senderIcon = value
|
self.senderIcon = value
|
||||||
|
|
||||||
|
proc senderIdenticon*(self: Item): string {.inline.} =
|
||||||
|
self.senderIdenticon
|
||||||
|
|
||||||
proc isSenderIconIdenticon*(self: Item): bool {.inline.} =
|
proc isSenderIconIdenticon*(self: Item): bool {.inline.} =
|
||||||
self.isSenderIconIdenticon
|
self.isSenderIconIdenticon
|
||||||
|
|
||||||
|
@ -152,6 +162,12 @@ proc `isSenderIconIdenticon=`*(self: Item, value: bool) {.inline.} =
|
||||||
proc amISender*(self: Item): bool {.inline.} =
|
proc amISender*(self: Item): bool {.inline.} =
|
||||||
self.amISender
|
self.amISender
|
||||||
|
|
||||||
|
proc senderIsAdded*(self: Item): bool {.inline.} =
|
||||||
|
self.senderIsAdded
|
||||||
|
|
||||||
|
proc `senderIsAdded=`*(self: Item, value: bool) {.inline.} =
|
||||||
|
self.senderIsAdded = value
|
||||||
|
|
||||||
proc outgoingStatus*(self: Item): string {.inline.} =
|
proc outgoingStatus*(self: Item): string {.inline.} =
|
||||||
self.outgoingStatus
|
self.outgoingStatus
|
||||||
|
|
||||||
|
@ -234,7 +250,9 @@ proc toJsonNode*(self: Item): JsonNode =
|
||||||
"senderDisplayName": self.senderDisplayName,
|
"senderDisplayName": self.senderDisplayName,
|
||||||
"senderLocalName": self.senderLocalName,
|
"senderLocalName": self.senderLocalName,
|
||||||
"amISender": self.amISender,
|
"amISender": self.amISender,
|
||||||
|
"senderIsAdded": self.senderIsAdded,
|
||||||
"senderIcon": self.senderIcon,
|
"senderIcon": self.senderIcon,
|
||||||
|
"senderIdenticon": self.senderIdenticon,
|
||||||
"isSenderIconIdenticon": self.isSenderIconIdenticon,
|
"isSenderIconIdenticon": self.isSenderIconIdenticon,
|
||||||
"seen": self.seen,
|
"seen": self.seen,
|
||||||
"outgoingStatus": self.outgoingStatus,
|
"outgoingStatus": self.outgoingStatus,
|
||||||
|
|
|
@ -11,8 +11,10 @@ type
|
||||||
SenderDisplayName
|
SenderDisplayName
|
||||||
SenderLocalName
|
SenderLocalName
|
||||||
SenderIcon
|
SenderIcon
|
||||||
|
SenderIdenticon
|
||||||
IsSenderIconIdenticon
|
IsSenderIconIdenticon
|
||||||
AmISender
|
AmISender
|
||||||
|
SenderIsAdded
|
||||||
Seen
|
Seen
|
||||||
OutgoingStatus
|
OutgoingStatus
|
||||||
MessageText
|
MessageText
|
||||||
|
@ -82,8 +84,10 @@ QtObject:
|
||||||
ModelRole.SenderDisplayName.int:"senderDisplayName",
|
ModelRole.SenderDisplayName.int:"senderDisplayName",
|
||||||
ModelRole.SenderLocalName.int:"senderLocalName",
|
ModelRole.SenderLocalName.int:"senderLocalName",
|
||||||
ModelRole.SenderIcon.int:"senderIcon",
|
ModelRole.SenderIcon.int:"senderIcon",
|
||||||
|
ModelRole.SenderIdenticon.int:"senderIdenticon",
|
||||||
ModelRole.IsSenderIconIdenticon.int:"isSenderIconIdenticon",
|
ModelRole.IsSenderIconIdenticon.int:"isSenderIconIdenticon",
|
||||||
ModelRole.AmISender.int:"amISender",
|
ModelRole.AmISender.int:"amISender",
|
||||||
|
ModelRole.SenderIsAdded.int:"senderIsAdded",
|
||||||
ModelRole.Seen.int:"seen",
|
ModelRole.Seen.int:"seen",
|
||||||
ModelRole.OutgoingStatus.int:"outgoingStatus",
|
ModelRole.OutgoingStatus.int:"outgoingStatus",
|
||||||
ModelRole.MessageText.int:"messageText",
|
ModelRole.MessageText.int:"messageText",
|
||||||
|
@ -130,10 +134,14 @@ QtObject:
|
||||||
result = newQVariant(item.senderLocalName)
|
result = newQVariant(item.senderLocalName)
|
||||||
of ModelRole.SenderIcon:
|
of ModelRole.SenderIcon:
|
||||||
result = newQVariant(item.senderIcon)
|
result = newQVariant(item.senderIcon)
|
||||||
|
of ModelRole.SenderIdenticon:
|
||||||
|
result = newQVariant(item.senderIdenticon)
|
||||||
of ModelRole.IsSenderIconIdenticon:
|
of ModelRole.IsSenderIconIdenticon:
|
||||||
result = newQVariant(item.isSenderIconIdenticon)
|
result = newQVariant(item.isSenderIconIdenticon)
|
||||||
of ModelRole.AmISender:
|
of ModelRole.AmISender:
|
||||||
result = newQVariant(item.amISender)
|
result = newQVariant(item.amISender)
|
||||||
|
of ModelRole.SenderIsAdded:
|
||||||
|
result = newQVariant(item.senderIsAdded)
|
||||||
of ModelRole.Seen:
|
of ModelRole.Seen:
|
||||||
result = newQVariant(item.seen)
|
result = newQVariant(item.seen)
|
||||||
of ModelRole.OutgoingStatus:
|
of ModelRole.OutgoingStatus:
|
||||||
|
@ -336,7 +344,7 @@ QtObject:
|
||||||
var roles: seq[int]
|
var roles: seq[int]
|
||||||
if(self.items[i].senderId == contactId):
|
if(self.items[i].senderId == contactId):
|
||||||
roles = @[ModelRole.SenderDisplayName.int, ModelRole.SenderLocalName.int, ModelRole.SenderIcon.int,
|
roles = @[ModelRole.SenderDisplayName.int, ModelRole.SenderLocalName.int, ModelRole.SenderIcon.int,
|
||||||
ModelRole.IsSenderIconIdenticon.int]
|
ModelRole.IsSenderIconIdenticon.int, ModelRole.SenderIsAdded.int]
|
||||||
if(self.items[i].pinnedBy == contactId):
|
if(self.items[i].pinnedBy == contactId):
|
||||||
roles.add(ModelRole.PinnedBy.int)
|
roles.add(ModelRole.PinnedBy.int)
|
||||||
if(self.items[i].messageContainsMentions):
|
if(self.items[i].messageContainsMentions):
|
||||||
|
|
|
@ -18,7 +18,9 @@ type
|
||||||
alias: string
|
alias: string
|
||||||
onlineStatus: OnlineStatus
|
onlineStatus: OnlineStatus
|
||||||
icon: string
|
icon: string
|
||||||
|
identicon: string
|
||||||
isIdenticon: bool
|
isIdenticon: bool
|
||||||
|
isAdded: bool
|
||||||
isAdmin: bool
|
isAdmin: bool
|
||||||
joined: bool
|
joined: bool
|
||||||
|
|
||||||
|
@ -30,7 +32,9 @@ proc initItem*(
|
||||||
alias: string,
|
alias: string,
|
||||||
onlineStatus: OnlineStatus,
|
onlineStatus: OnlineStatus,
|
||||||
icon: string,
|
icon: string,
|
||||||
|
identicon: string,
|
||||||
isidenticon: bool,
|
isidenticon: bool,
|
||||||
|
isAdded: bool = false,
|
||||||
isAdmin: bool = false,
|
isAdmin: bool = false,
|
||||||
joined: bool = false,
|
joined: bool = false,
|
||||||
): Item =
|
): Item =
|
||||||
|
@ -42,7 +46,9 @@ proc initItem*(
|
||||||
result.alias = alias
|
result.alias = alias
|
||||||
result.onlineStatus = onlineStatus
|
result.onlineStatus = onlineStatus
|
||||||
result.icon = icon
|
result.icon = icon
|
||||||
|
result.identicon = identicon
|
||||||
result.isIdenticon = isidenticon
|
result.isIdenticon = isidenticon
|
||||||
|
result.isAdded = isAdded
|
||||||
result.isAdmin = isAdmin
|
result.isAdmin = isAdmin
|
||||||
result.joined = joined
|
result.joined = joined
|
||||||
|
|
||||||
|
@ -54,7 +60,9 @@ proc `$`*(self: Item): string =
|
||||||
alias: {self.alias},
|
alias: {self.alias},
|
||||||
onlineStatus: {$self.onlineStatus.int},
|
onlineStatus: {$self.onlineStatus.int},
|
||||||
icon: {self.icon},
|
icon: {self.icon},
|
||||||
|
identicon: {self.identicon},
|
||||||
isIdenticon: {$self.isIdenticon}
|
isIdenticon: {$self.isIdenticon}
|
||||||
|
isAdded: {$self.isAdded}
|
||||||
isAdmin: {$self.isAdmin}
|
isAdmin: {$self.isAdmin}
|
||||||
joined: {$self.joined}
|
joined: {$self.joined}
|
||||||
]"""
|
]"""
|
||||||
|
@ -98,6 +106,9 @@ proc icon*(self: Item): string {.inline.} =
|
||||||
proc `icon=`*(self: Item, value: string) {.inline.} =
|
proc `icon=`*(self: Item, value: string) {.inline.} =
|
||||||
self.icon = value
|
self.icon = value
|
||||||
|
|
||||||
|
proc identicon*(self: Item): string {.inline.} =
|
||||||
|
self.identicon
|
||||||
|
|
||||||
proc isIdenticon*(self: Item): bool {.inline.} =
|
proc isIdenticon*(self: Item): bool {.inline.} =
|
||||||
self.isIdenticon
|
self.isIdenticon
|
||||||
|
|
||||||
|
@ -110,6 +121,12 @@ proc isAdmin*(self: Item): bool {.inline.} =
|
||||||
proc `isAdmin=`*(self: Item, value: bool) {.inline.} =
|
proc `isAdmin=`*(self: Item, value: bool) {.inline.} =
|
||||||
self.isAdmin = value
|
self.isAdmin = value
|
||||||
|
|
||||||
|
proc isAdded*(self: Item): bool {.inline.} =
|
||||||
|
self.isAdded
|
||||||
|
|
||||||
|
proc `isAdded=`*(self: Item, value: bool) {.inline.} =
|
||||||
|
self.isAdded = value
|
||||||
|
|
||||||
proc joined*(self: Item): bool {.inline.} =
|
proc joined*(self: Item): bool {.inline.} =
|
||||||
self.joined
|
self.joined
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ type
|
||||||
Alias
|
Alias
|
||||||
OnlineStatus
|
OnlineStatus
|
||||||
Icon
|
Icon
|
||||||
|
Identicon
|
||||||
IsIdenticon
|
IsIdenticon
|
||||||
|
IsAdded
|
||||||
IsAdmin
|
IsAdmin
|
||||||
Joined
|
Joined
|
||||||
|
|
||||||
|
@ -62,7 +64,9 @@ QtObject:
|
||||||
ModelRole.Alias.int:"alias",
|
ModelRole.Alias.int:"alias",
|
||||||
ModelRole.OnlineStatus.int:"onlineStatus",
|
ModelRole.OnlineStatus.int:"onlineStatus",
|
||||||
ModelRole.Icon.int:"icon",
|
ModelRole.Icon.int:"icon",
|
||||||
|
ModelRole.Identicon.int:"identicon",
|
||||||
ModelRole.IsIdenticon.int:"isIdenticon",
|
ModelRole.IsIdenticon.int:"isIdenticon",
|
||||||
|
ModelRole.IsAdded.int:"isAdded",
|
||||||
ModelRole.IsAdmin.int:"isAdmin",
|
ModelRole.IsAdmin.int:"isAdmin",
|
||||||
ModelRole.Joined.int:"joined",
|
ModelRole.Joined.int:"joined",
|
||||||
}.toTable
|
}.toTable
|
||||||
|
@ -92,8 +96,12 @@ QtObject:
|
||||||
result = newQVariant(item.onlineStatus.int)
|
result = newQVariant(item.onlineStatus.int)
|
||||||
of ModelRole.Icon:
|
of ModelRole.Icon:
|
||||||
result = newQVariant(item.icon)
|
result = newQVariant(item.icon)
|
||||||
|
of ModelRole.Identicon:
|
||||||
|
result = newQVariant(item.identicon)
|
||||||
of ModelRole.IsIdenticon:
|
of ModelRole.IsIdenticon:
|
||||||
result = newQVariant(item.isIdenticon)
|
result = newQVariant(item.isIdenticon)
|
||||||
|
of ModelRole.IsAdded:
|
||||||
|
result = newQVariant(item.isAdded)
|
||||||
of ModelRole.IsAdmin:
|
of ModelRole.IsAdmin:
|
||||||
result = newQVariant(item.isAdmin)
|
result = newQVariant(item.isAdmin)
|
||||||
of ModelRole.Joined:
|
of ModelRole.Joined:
|
||||||
|
@ -175,6 +183,7 @@ QtObject:
|
||||||
alias: string,
|
alias: string,
|
||||||
icon: string,
|
icon: string,
|
||||||
isIdenticon: bool,
|
isIdenticon: bool,
|
||||||
|
isAdded: bool = false,
|
||||||
isAdmin: bool = false,
|
isAdmin: bool = false,
|
||||||
joined: bool = false
|
joined: bool = false
|
||||||
) =
|
) =
|
||||||
|
@ -188,6 +197,7 @@ QtObject:
|
||||||
self.items[ind].alias = alias
|
self.items[ind].alias = alias
|
||||||
self.items[ind].icon = icon
|
self.items[ind].icon = icon
|
||||||
self.items[ind].isIdenticon = isIdenticon
|
self.items[ind].isIdenticon = isIdenticon
|
||||||
|
self.items[ind].isAdded = isAdded
|
||||||
self.items[ind].isAdmin = isAdmin
|
self.items[ind].isAdmin = isAdmin
|
||||||
self.items[ind].joined = joined
|
self.items[ind].joined = joined
|
||||||
|
|
||||||
|
@ -198,7 +208,8 @@ QtObject:
|
||||||
ModelRole.Nickname.int,
|
ModelRole.Nickname.int,
|
||||||
ModelRole.Alias.int,
|
ModelRole.Alias.int,
|
||||||
ModelRole.Icon.int,
|
ModelRole.Icon.int,
|
||||||
ModelRole.IsIdenticon.int,
|
ModelRole.Identicon.int,
|
||||||
|
ModelRole.IsAdded.int,
|
||||||
ModelRole.IsAdmin.int,
|
ModelRole.IsAdmin.int,
|
||||||
ModelRole.Joined.int,
|
ModelRole.Joined.int,
|
||||||
])
|
])
|
||||||
|
|
|
@ -200,6 +200,7 @@ QtObject:
|
||||||
identicon: singletonInstance.userProfile.getIdenticon(),
|
identicon: singletonInstance.userProfile.getIdenticon(),
|
||||||
alias: singletonInstance.userProfile.getUsername(),
|
alias: singletonInstance.userProfile.getUsername(),
|
||||||
ensVerified: singletonInstance.userProfile.getEnsName().len > 0,
|
ensVerified: singletonInstance.userProfile.getEnsName().len > 0,
|
||||||
|
added: true,
|
||||||
image: Images(
|
image: Images(
|
||||||
thumbnail: singletonInstance.userProfile.getThumbnailImage(),
|
thumbnail: singletonInstance.userProfile.getThumbnailImage(),
|
||||||
large: singletonInstance.userProfile.getLargeImage()
|
large: singletonInstance.userProfile.getLargeImage()
|
||||||
|
|
|
@ -45,6 +45,10 @@ const KEY_GIF_FAVORITES* = "gifs/favorite-gifs"
|
||||||
const KEY_GIF_RECENTS* = "gifs/recent-gifs"
|
const KEY_GIF_RECENTS* = "gifs/recent-gifs"
|
||||||
const KEY_GIF_API_KEY* = "gifs/api-key"
|
const KEY_GIF_API_KEY* = "gifs/api-key"
|
||||||
|
|
||||||
|
const PROFILE_PICTURES_VISIBILITY_CONTACTS_ONLY* = 1
|
||||||
|
const PROFILE_PICTURES_VISIBILITY_EVERYONE* = 2
|
||||||
|
const PROFILE_PICTURES_VISIBILITY_NO_ONE* = 3
|
||||||
|
|
||||||
type UpstreamConfig* = object
|
type UpstreamConfig* = object
|
||||||
Enabled*: bool
|
Enabled*: bool
|
||||||
URL*: string
|
URL*: string
|
||||||
|
|
|
@ -6,6 +6,7 @@ import service_interface, ./dto/settings
|
||||||
import ../../../backend/settings as status_settings
|
import ../../../backend/settings as status_settings
|
||||||
|
|
||||||
export service_interface
|
export service_interface
|
||||||
|
export settings
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
topics = "settings-service"
|
topics = "settings-service"
|
||||||
|
|
|
@ -18,7 +18,18 @@ Item {
|
||||||
property string publicKey: ""
|
property string publicKey: ""
|
||||||
property string name: ""
|
property string name: ""
|
||||||
property string icon: ""
|
property string icon: ""
|
||||||
|
property string identicon: ""
|
||||||
property bool isIdenticon: true
|
property bool isIdenticon: true
|
||||||
|
property bool isAdded: false
|
||||||
|
property string iconToShow: {
|
||||||
|
if (isIdenticon || (!isAdded &&
|
||||||
|
Global.privacyModuleInst.profilePicturesVisibility !==
|
||||||
|
Constants.profilePicturesVisibility.everyone)) {
|
||||||
|
return identicon
|
||||||
|
}
|
||||||
|
|
||||||
|
return icon
|
||||||
|
}
|
||||||
property int userStatus: Constants.userStatus.offline
|
property int userStatus: Constants.userStatus.offline
|
||||||
property var messageContextMenu
|
property var messageContextMenu
|
||||||
property bool enableMouseArea: true
|
property bool enableMouseArea: true
|
||||||
|
@ -45,7 +56,7 @@ Item {
|
||||||
image: StatusImageSettings {
|
image: StatusImageSettings {
|
||||||
width: 28
|
width: 28
|
||||||
height: 28
|
height: 28
|
||||||
source: wrapper.icon
|
source: wrapper.iconToShow
|
||||||
isIdenticon: wrapper.isIdenticon
|
isIdenticon: wrapper.isIdenticon
|
||||||
}
|
}
|
||||||
icon: StatusIconSettings {
|
icon: StatusIconSettings {
|
||||||
|
@ -118,7 +129,7 @@ Item {
|
||||||
messageContextMenu.myPublicKey = userProfile.pubKey
|
messageContextMenu.myPublicKey = userProfile.pubKey
|
||||||
messageContextMenu.selectedUserPublicKey = wrapper.publicKey
|
messageContextMenu.selectedUserPublicKey = wrapper.publicKey
|
||||||
messageContextMenu.selectedUserDisplayName = wrapper.name
|
messageContextMenu.selectedUserDisplayName = wrapper.name
|
||||||
messageContextMenu.selectedUserIcon = wrapper.icon
|
messageContextMenu.selectedUserIcon = wrapper.iconToShow
|
||||||
messageContextMenu.isSelectedUserIconIdenticon = wrapper.isIdenticon
|
messageContextMenu.isSelectedUserIconIdenticon = wrapper.isIdenticon
|
||||||
messageContextMenu.popup()
|
messageContextMenu.popup()
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,9 @@ Item {
|
||||||
publicKey: model.id
|
publicKey: model.id
|
||||||
name: model.name
|
name: model.name
|
||||||
icon: model.icon
|
icon: model.icon
|
||||||
|
identicon: model.identicon
|
||||||
isIdenticon: model.isIdenticon
|
isIdenticon: model.isIdenticon
|
||||||
|
isAdded: model.isAdded
|
||||||
userStatus: model.onlineStatus
|
userStatus: model.onlineStatus
|
||||||
messageContextMenu: root.messageContextMenu
|
messageContextMenu: root.messageContextMenu
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,6 +255,8 @@ Item {
|
||||||
senderDisplayName: model.senderDisplayName
|
senderDisplayName: model.senderDisplayName
|
||||||
senderLocalName: model.senderLocalName
|
senderLocalName: model.senderLocalName
|
||||||
senderIcon: model.senderIcon
|
senderIcon: model.senderIcon
|
||||||
|
senderIdenticon: model.senderIdenticon
|
||||||
|
senderIsAdded: model.senderIsAdded
|
||||||
isSenderIconIdenticon: model.isSenderIconIdenticon
|
isSenderIconIdenticon: model.isSenderIconIdenticon
|
||||||
amISender: model.amISender
|
amISender: model.amISender
|
||||||
message: model.messageText
|
message: model.messageText
|
||||||
|
|
|
@ -18,6 +18,10 @@ StatusAppTwoPanelLayout {
|
||||||
property var globalStore
|
property var globalStore
|
||||||
property var systemPalette
|
property var systemPalette
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
Global.privacyModuleInst = store.privacyStore.privacyModule
|
||||||
|
}
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id: _internal
|
id: _internal
|
||||||
readonly property int contentMaxWidth: 624
|
readonly property int contentMaxWidth: 624
|
||||||
|
|
|
@ -8,6 +8,7 @@ QtObject {
|
||||||
|
|
||||||
// Module Properties
|
// Module Properties
|
||||||
property bool mnemonicBackedUp: privacyModule.mnemonicBackedUp
|
property bool mnemonicBackedUp: privacyModule.mnemonicBackedUp
|
||||||
|
property int profilePicturesVisibility: privacyModule.profilePicturesVisibility
|
||||||
|
|
||||||
function getLinkPreviewWhitelist() {
|
function getLinkPreviewWhitelist() {
|
||||||
return root.privacyModule.getLinkPreviewWhitelist()
|
return root.privacyModule.getLinkPreviewWhitelist()
|
||||||
|
@ -32,4 +33,8 @@ QtObject {
|
||||||
function validatePassword(password) {
|
function validatePassword(password) {
|
||||||
return root.privacyModule.validatePassword(password)
|
return root.privacyModule.validatePassword(password)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setProfilePicturesVisibility(value) {
|
||||||
|
return root.privacyModule.setProfilePicturesVisibility(value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,6 +148,7 @@ Item {
|
||||||
bottomPadding: Style.current.halfPadding
|
bottomPadding: Style.current.halfPadding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO change this component from a switch to a chooser between, everyone, contacts and no one
|
||||||
StatusListItem {
|
StatusListItem {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: -Style.current.padding
|
anchors.leftMargin: -Style.current.padding
|
||||||
|
@ -159,10 +160,19 @@ Item {
|
||||||
components: [
|
components: [
|
||||||
StatusQControls.StatusSwitch {
|
StatusQControls.StatusSwitch {
|
||||||
id: switch1
|
id: switch1
|
||||||
checked: !localAccountSensitiveSettings.onlyShowContactsProfilePics
|
checked: root.privacyStore.profilePicturesVisibility ===
|
||||||
|
Constants.profilePicturesVisibility.everyone
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
if (localAccountSensitiveSettings.onlyShowContactsProfilePics === checked) {
|
if (checked && root.privacyStore.profilePicturesVisibility !==
|
||||||
localAccountSensitiveSettings.onlyShowContactsProfilePics = !checked
|
Constants.profilePicturesVisibility.everyone) {
|
||||||
|
root.privacyStore.setProfilePicturesVisibility(
|
||||||
|
Constants.profilePicturesVisibility.everyone
|
||||||
|
)
|
||||||
|
} else if (!checked && root.privacyStore.profilePicturesVisibility ===
|
||||||
|
Constants.profilePicturesVisibility.everyone) {
|
||||||
|
root.privacyStore.setProfilePicturesVisibility(
|
||||||
|
Constants.profilePicturesVisibility.contacts
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,13 @@ StatusModal {
|
||||||
userName = contactDetails.alias
|
userName = contactDetails.alias
|
||||||
userNickname = contactDetails.localNickname
|
userNickname = contactDetails.localNickname
|
||||||
userEnsName = contactDetails.name
|
userEnsName = contactDetails.name
|
||||||
userIcon = contactDetails.displayIcon
|
if (contactDetails.isDisplayIconIdenticon || (!contactDetails.isContact &&
|
||||||
|
Global.privacyModuleInst.profilePicturesVisibility !==
|
||||||
|
Constants.profilePicturesVisibility.everyone)) {
|
||||||
|
userIcon = contactDetails.identicon
|
||||||
|
} else {
|
||||||
|
userIcon = contactDetails.displayIcon
|
||||||
|
}
|
||||||
userIsEnsVerified = contactDetails.ensVerified
|
userIsEnsVerified = contactDetails.ensVerified
|
||||||
userIsBlocked = contactDetails.isBlocked
|
userIsBlocked = contactDetails.isBlocked
|
||||||
isAddedContact = contactDetails.isContact
|
isAddedContact = contactDetails.isContact
|
||||||
|
|
|
@ -34,6 +34,8 @@ Item {
|
||||||
property int stickerPack
|
property int stickerPack
|
||||||
property bool isMessageActive: false
|
property bool isMessageActive: false
|
||||||
property bool amISender: false
|
property bool amISender: false
|
||||||
|
property string senderIcon: ""
|
||||||
|
property bool isSenderIconIdenticon: true
|
||||||
property bool isHovered: false
|
property bool isHovered: false
|
||||||
property bool isInPinnedPopup: false
|
property bool isInPinnedPopup: false
|
||||||
property string communityId
|
property string communityId
|
||||||
|
@ -317,8 +319,8 @@ Item {
|
||||||
anchors.top: chatReply.active ? chatReply.bottom :
|
anchors.top: chatReply.active ? chatReply.bottom :
|
||||||
pinnedRectangleLoader.active ? pinnedRectangleLoader.bottom : parent.top
|
pinnedRectangleLoader.active ? pinnedRectangleLoader.bottom : parent.top
|
||||||
anchors.topMargin: chatReply.active || pinnedRectangleLoader.active ? 4 : Style.current.smallPadding
|
anchors.topMargin: chatReply.active || pinnedRectangleLoader.active ? 4 : Style.current.smallPadding
|
||||||
icon: senderIcon
|
icon: root.senderIcon
|
||||||
isIdenticon: isSenderIconIdenticon
|
isIdenticon: root.isSenderIconIdenticon
|
||||||
onClickMessage: {
|
onClickMessage: {
|
||||||
root.clickMessage(isProfileClick, isSticker, isImage, image, emojiOnly, hideEmojiPicker, isReply, false, "")
|
root.clickMessage(isProfileClick, isSticker, isImage, image, emojiOnly, hideEmojiPicker, isReply, false, "")
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,18 @@ Column {
|
||||||
property string senderDisplayName: ""
|
property string senderDisplayName: ""
|
||||||
property string senderLocalName: ""
|
property string senderLocalName: ""
|
||||||
property string senderIcon: ""
|
property string senderIcon: ""
|
||||||
|
property string senderIdenticon: ""
|
||||||
property bool isSenderIconIdenticon: true
|
property bool isSenderIconIdenticon: true
|
||||||
property bool amISender: false
|
property bool amISender: false
|
||||||
|
property bool senderIsAdded: false
|
||||||
|
property string senderIconToShow: {
|
||||||
|
if (isSenderIconIdenticon || (!senderIsAdded &&
|
||||||
|
Global.privacyModuleInst.profilePicturesVisibility !==
|
||||||
|
Constants.profilePicturesVisibility.everyone)) {
|
||||||
|
return senderIdenticon
|
||||||
|
}
|
||||||
|
return senderIcon
|
||||||
|
}
|
||||||
property string message: ""
|
property string message: ""
|
||||||
property string messageImage: ""
|
property string messageImage: ""
|
||||||
property string messageTimestamp: ""
|
property string messageTimestamp: ""
|
||||||
|
@ -170,7 +180,7 @@ Column {
|
||||||
|
|
||||||
messageContextMenu.selectedUserPublicKey = root.senderId
|
messageContextMenu.selectedUserPublicKey = root.senderId
|
||||||
messageContextMenu.selectedUserDisplayName = root.senderDisplayName
|
messageContextMenu.selectedUserDisplayName = root.senderDisplayName
|
||||||
messageContextMenu.selectedUserIcon = root.senderIcon
|
messageContextMenu.selectedUserIcon = root.senderIconToShow
|
||||||
messageContextMenu.isSelectedUserIconIdenticon = root.isSenderIconIdenticon
|
messageContextMenu.isSelectedUserIconIdenticon = root.isSenderIconIdenticon
|
||||||
|
|
||||||
messageContextMenu.imageSource = imageSource
|
messageContextMenu.imageSource = imageSource
|
||||||
|
@ -374,6 +384,8 @@ Column {
|
||||||
sticker: root.sticker
|
sticker: root.sticker
|
||||||
stickerPack: root.stickerPack
|
stickerPack: root.stickerPack
|
||||||
isMessageActive: root.isMessageActive
|
isMessageActive: root.isMessageActive
|
||||||
|
isSenderIconIdenticon: root.isSenderIconIdenticon
|
||||||
|
senderIcon: root.senderIconToShow
|
||||||
amISender: root.amISender
|
amISender: root.amISender
|
||||||
isHovered: root.isHovered
|
isHovered: root.isHovered
|
||||||
editModeOn: root.editModeOn
|
editModeOn: root.editModeOn
|
||||||
|
|
|
@ -79,6 +79,12 @@ QtObject {
|
||||||
readonly property int editType: 11
|
readonly property int editType: 11
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readonly property QtObject profilePicturesVisibility: QtObject {
|
||||||
|
readonly property int contactsOnly: 1
|
||||||
|
readonly property int everyone: 2
|
||||||
|
readonly property int noOne: 3
|
||||||
|
}
|
||||||
|
|
||||||
readonly property int communityImported: 0
|
readonly property int communityImported: 0
|
||||||
readonly property int communityImportingInProgress: 1
|
readonly property int communityImportingInProgress: 1
|
||||||
readonly property int communityImportingError: 2
|
readonly property int communityImportingError: 2
|
||||||
|
|
|
@ -13,6 +13,7 @@ QtObject {
|
||||||
property var errorSound
|
property var errorSound
|
||||||
|
|
||||||
property var mainModuleInst
|
property var mainModuleInst
|
||||||
|
property var privacyModuleInst
|
||||||
property var toastMessage
|
property var toastMessage
|
||||||
property bool profilePopupOpened: false
|
property bool profilePopupOpened: false
|
||||||
property string currentNetworkId: ""
|
property string currentNetworkId: ""
|
||||||
|
@ -58,7 +59,9 @@ QtObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
let contactDetails = Utils.getContactDetailsAsJson(pubkey)
|
let contactDetails = Utils.getContactDetailsAsJson(pubkey)
|
||||||
if (localAccountSensitiveSettings.onlyShowContactsProfilePics && !contactDetails.isContact) {
|
|
||||||
|
if (root.privacyModuleInst.profilePicturesVisibility !==
|
||||||
|
Constants.profilePicturesVisibility.everyone && !contactDetails.isContact) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue