mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-20 02:28:56 +00:00
toggle switch to control if status should be broadcasted or not
This commit is contained in:
parent
6849091460
commit
7aaca9ec4d
@ -40,10 +40,12 @@ proc init*(self: ProfileController, account: Account) =
|
|||||||
let network = self.status.settings.getSetting[:string](Setting.Networks_CurrentNetwork, DEFAULT_NETWORK_NAME)
|
let network = self.status.settings.getSetting[:string](Setting.Networks_CurrentNetwork, DEFAULT_NETWORK_NAME)
|
||||||
let appearance = self.status.settings.getSetting[:int](Setting.Appearance)
|
let appearance = self.status.settings.getSetting[:int](Setting.Appearance)
|
||||||
let messagesFromContactsOnly = self.status.settings.getSetting[:bool](Setting.MessagesFromContactsOnly)
|
let messagesFromContactsOnly = self.status.settings.getSetting[:bool](Setting.MessagesFromContactsOnly)
|
||||||
|
let sendUserStatus = self.status.settings.getSetting[:bool](Setting.SendUserStatus)
|
||||||
profile.appearance = appearance
|
profile.appearance = appearance
|
||||||
profile.id = pubKey
|
profile.id = pubKey
|
||||||
profile.address = account.keyUid
|
profile.address = account.keyUid
|
||||||
profile.messagesFromContactsOnly = messagesFromContactsOnly
|
profile.messagesFromContactsOnly = messagesFromContactsOnly
|
||||||
|
profile.sendUserStatus = sendUserStatus
|
||||||
|
|
||||||
let identityImage = self.status.profile.getIdentityImage(profile.address)
|
let identityImage = self.status.profile.getIdentityImage(profile.address)
|
||||||
|
|
||||||
|
@ -179,3 +179,10 @@ QtObject:
|
|||||||
|
|
||||||
QtProperty[QVariant] mutedChats:
|
QtProperty[QVariant] mutedChats:
|
||||||
read = getMutedChats
|
read = getMutedChats
|
||||||
|
|
||||||
|
proc setSendUserStatus*(self: ProfileView, sendUserStatus: bool) {.slot.} =
|
||||||
|
if (sendUserStatus == self.profile.sendUserStatus):
|
||||||
|
return
|
||||||
|
self.profile.setSendUserStatus(sendUserStatus)
|
||||||
|
self.status.saveSetting(Setting.SendUserStatus, sendUserStatus)
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ QtObject:
|
|||||||
appearance*: int
|
appearance*: int
|
||||||
ensVerified*: bool
|
ensVerified*: bool
|
||||||
messagesFromContactsOnly*: bool
|
messagesFromContactsOnly*: bool
|
||||||
|
sendUserStatus*: bool
|
||||||
|
|
||||||
proc setup(self: ProfileInfoView) =
|
proc setup(self: ProfileInfoView) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
@ -31,6 +32,7 @@ QtObject:
|
|||||||
result.identityImage = IdentityImage()
|
result.identityImage = IdentityImage()
|
||||||
result.ensVerified = false
|
result.ensVerified = false
|
||||||
result.messagesFromContactsOnly = false
|
result.messagesFromContactsOnly = false
|
||||||
|
result.sendUserStatus = false
|
||||||
result.setup
|
result.setup
|
||||||
|
|
||||||
proc profileChanged*(self: ProfileInfoView) {.signal.}
|
proc profileChanged*(self: ProfileInfoView) {.signal.}
|
||||||
@ -46,6 +48,7 @@ QtObject:
|
|||||||
self.ensVerified = profile.ensVerified
|
self.ensVerified = profile.ensVerified
|
||||||
self.identityImage = profile.identityImage
|
self.identityImage = profile.identityImage
|
||||||
self.messagesFromContactsOnly = profile.messagesFromContactsOnly
|
self.messagesFromContactsOnly = profile.messagesFromContactsOnly
|
||||||
|
self.sendUserStatus = profile.sendUserStatus
|
||||||
self.profileChanged()
|
self.profileChanged()
|
||||||
|
|
||||||
proc setIdentityImage*(self: ProfileInfoView, identityImage: IdentityImage) =
|
proc setIdentityImage*(self: ProfileInfoView, identityImage: IdentityImage) =
|
||||||
@ -130,3 +133,14 @@ QtObject:
|
|||||||
QtProperty[bool] ensVerified:
|
QtProperty[bool] ensVerified:
|
||||||
read = ensVerified
|
read = ensVerified
|
||||||
notify = profileChanged
|
notify = profileChanged
|
||||||
|
|
||||||
|
proc sendUserStatus*(self: ProfileInfoView): bool {.slot.} = result = self.sendUserStatus
|
||||||
|
proc setSendUserStatus*(self: ProfileInfoView, sendUserStatus: bool) {.slot.} =
|
||||||
|
if self.sendUserStatus == sendUserStatus:
|
||||||
|
return
|
||||||
|
self.sendUserStatus = sendUserStatus
|
||||||
|
self.profileChanged()
|
||||||
|
QtProperty[bool] sendUserStatus:
|
||||||
|
read = sendUserStatus
|
||||||
|
write = setSendUserStatus
|
||||||
|
notify = profileChanged
|
@ -5,6 +5,7 @@ type Profile* = ref object
|
|||||||
id*, alias*, username*, identicon*, address*, ensName*, localNickname*: string
|
id*, alias*, username*, identicon*, address*, ensName*, localNickname*: string
|
||||||
ensVerified*: bool
|
ensVerified*: bool
|
||||||
messagesFromContactsOnly*: bool
|
messagesFromContactsOnly*: bool
|
||||||
|
sendUserStatus*: bool
|
||||||
identityImage*: IdentityImage
|
identityImage*: IdentityImage
|
||||||
appearance*: int
|
appearance*: int
|
||||||
systemTags*: seq[string]
|
systemTags*: seq[string]
|
||||||
|
@ -197,6 +197,7 @@ type
|
|||||||
VisibleTokens = "wallet/visible-tokens"
|
VisibleTokens = "wallet/visible-tokens"
|
||||||
PinnedMailservers = "pinned-mailservers"
|
PinnedMailservers = "pinned-mailservers"
|
||||||
WakuBloomFilterMode = "waku-bloom-filter-mode"
|
WakuBloomFilterMode = "waku-bloom-filter-mode"
|
||||||
|
SendUserStatus = "send-status-updates?"
|
||||||
|
|
||||||
UpstreamConfig* = ref object
|
UpstreamConfig* = ref object
|
||||||
enabled* {.serializedFieldName("Enabled").}: bool
|
enabled* {.serializedFieldName("Enabled").}: bool
|
||||||
|
@ -42,8 +42,7 @@ Rectangle {
|
|||||||
property string nickname: appMain.getUserNickname(model.pubKey)
|
property string nickname: appMain.getUserNickname(model.pubKey)
|
||||||
|
|
||||||
publicKey: model.pubKey
|
publicKey: model.pubKey
|
||||||
name: chatsModel.communities.activeCommunity.memberLastSeen(model.pubKey) + "--" + ( !model.userName.endsWith(".eth") && !!nickname ?
|
name: !model.userName.endsWith(".eth") && !!nickname ? nickname : Utils.removeStatusEns(model.userName)
|
||||||
nickname : Utils.removeStatusEns(model.userName))
|
|
||||||
identicon: model.identicon
|
identicon: model.identicon
|
||||||
lastSeen: chatsModel.communities.activeCommunity.memberLastSeen(model.pubKey)
|
lastSeen: chatsModel.communities.activeCommunity.memberLastSeen(model.pubKey)
|
||||||
currentTime: svRoot.currentTime
|
currentTime: svRoot.currentTime
|
||||||
|
@ -126,8 +126,8 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StatusSettingsLineButton {
|
StatusSettingsLineButton {
|
||||||
//% "Online users"
|
id: onlineUsers
|
||||||
text: qsTrId("online-users")
|
text: qsTr("Online users")
|
||||||
isSwitch: true
|
isSwitch: true
|
||||||
switchChecked: appSettings.showOnlineUsers
|
switchChecked: appSettings.showOnlineUsers
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@ -135,6 +135,20 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: onlineUsers.switchChecked
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
sourceComponent: StatusSettingsLineButton {
|
||||||
|
text: qsTr("Broadcast user status")
|
||||||
|
isSwitch: true
|
||||||
|
switchChecked: profileModel.profile.sendUserStatus
|
||||||
|
onClicked: function (checked) {
|
||||||
|
profileModel.setSendUserStatus(checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StatusSectionHeadline {
|
StatusSectionHeadline {
|
||||||
text: qsTr("Bloom filter level")
|
text: qsTr("Bloom filter level")
|
||||||
topPadding: Style.current.bigPadding
|
topPadding: Style.current.bigPadding
|
||||||
|
Loading…
x
Reference in New Issue
Block a user