diff --git a/features/groups/group_functionality.go b/features/groups/group_functionality.go index df83f9b..727f5f2 100644 --- a/features/groups/group_functionality.go +++ b/features/groups/group_functionality.go @@ -96,7 +96,7 @@ func (gf *GroupFunctionality) HandleImportString(peer peer.CwtchPeer, importStri if len(bundle) == 2 { err := gf.HandleImportString(peer, bundle[0][len(tofuBundlePrefix):]) // if the server import failed then abort the whole process.. - if !strings.HasSuffix(err.Error(), "success") { + if err != nil && !strings.HasSuffix(err.Error(), "success") { return features.ConstructResponse(importBundlePrefix, err.Error()) } return gf.HandleImportString(peer, bundle[1]) diff --git a/go.mod b/go.mod index a3b5288..50b42fa 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.openprivacy.ca/cwtch.im/libcwtch-go go 1.15 require ( - cwtch.im/cwtch v0.11.2 + cwtch.im/cwtch v0.12.2 git.openprivacy.ca/openprivacy/connectivity v1.5.0 git.openprivacy.ca/openprivacy/log v1.0.3 golang.org/x/mobile v0.0.0-20210716004757-34ab1303b554 // indirect diff --git a/go.sum b/go.sum index 9e6a0a9..df5c7a2 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,11 @@ cwtch.im/cwtch v0.11.2 h1:a38zZLSNsKJzLStBDOIoYKKIL56V9ueQvOZfnIEVc5I= cwtch.im/cwtch v0.11.2/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM= +cwtch.im/cwtch v0.12.0 h1:hEMee2/2s4kUwukGCTBpGww/KfrsE84e9tOLnM8lM78= +cwtch.im/cwtch v0.12.0/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM= +cwtch.im/cwtch v0.12.1 h1:3+OZtzZ9Kg+3Es/ntyPeg7Ku9XzOlSXcvC6rdezmuIM= +cwtch.im/cwtch v0.12.1/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM= +cwtch.im/cwtch v0.12.2 h1:I+ndKadCRCITw4SPbd+1cpRv+z/7iHjjTUv8OzRwTrE= +cwtch.im/cwtch v0.12.2/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= git.openprivacy.ca/cwtch.im/tapir v0.4.9 h1:LXonlztwvI1F1++0IyomIcDH1/Bxzo+oN8YjGonNvjM= diff --git a/lib.go b/lib.go index 437e1f0..2fec057 100644 --- a/lib.go +++ b/lib.go @@ -61,9 +61,9 @@ type ChatMessage struct { //export c_StartCwtch func c_StartCwtch(dir_c *C.char, len C.int, tor_c *C.char, torLen C.int) C.int { - dir := C.GoStringN(dir_c, len) - tor := C.GoStringN(tor_c, torLen) - return C.int(StartCwtch(dir, tor)) + applicationDirectory := C.GoStringN(dir_c, len) + torDirectory := C.GoStringN(tor_c, torLen) + return C.int(StartCwtch(applicationDirectory, torDirectory)) } // StartCwtch starts cwtch in the library and initlaizes all data structures @@ -75,8 +75,8 @@ func c_StartCwtch(dir_c *C.char, len C.int, tor_c *C.char, torLen C.int) C.int { func StartCwtch(appDir string, torPath string) int { if logfile := os.Getenv("LOG_FILE"); logfile != "" { filelog, err := log.NewFile(log.LevelInfo, logfile) - filelog.SetUseColor(false) if err == nil { + filelog.SetUseColor(false) log.SetStd(filelog) } else { // not so likely to be seen since we're usually creating file log in situations we can't access console logs... @@ -139,7 +139,11 @@ func _startCwtch(appDir string, torPath string) { eventHandler.PublishAppEvent(event.NewEventList(utils.CwtchStartError, event.Error, fmt.Sprintf("Error creating appDir %v: %v", appDir, err))) return } - utils.InitGlobalSettingsFile(appDir, constants.DefactoPasswordForUnencryptedProfiles) + + err = utils.InitGlobalSettingsFile(appDir, constants.DefactoPasswordForUnencryptedProfiles) + if err != nil { + log.Errorf("error initializing global settings file %. Global settings might not be loaded or saves", err) + } log.Infof("Loading Cwtch Directory %v and tor path: %v", appDir, torPath) @@ -155,8 +159,22 @@ func _startCwtch(appDir string, torPath string) { } log.Infof("making directory %v", appDir) - os.MkdirAll(filepath.Join(appDir, "tor"), 0700) - tor.NewTorrc().WithSocksPort(port).WithOnionTrafficOnly().WithControlPort(controlPort).WithHashedPassword(base64.StdEncoding.EncodeToString(key)).Build(filepath.Join(appDir, "tor", "torrc")) + err = os.MkdirAll(filepath.Join(appDir, "tor"), 0700) + + if err != nil { + log.Errorf("error creating tor data directory: %v. Aborting app start up", err) + eventHandler.PublishAppEvent(event.NewEventList(utils.CwtchStartError, event.Error, fmt.Sprintf("Error connecting to Tor: %v", err))) + return + } + + err = tor.NewTorrc().WithSocksPort(port).WithOnionTrafficOnly().WithControlPort(controlPort).WithHashedPassword(base64.StdEncoding.EncodeToString(key)).Build(filepath.Join(appDir, "tor", "torrc")) + + if err != nil { + log.Errorf("error constructing torrc: %v", err) + eventHandler.PublishAppEvent(event.NewEventList(utils.CwtchStartError, event.Error, fmt.Sprintf("Error connecting to Tor: %v", err))) + return + } + acn, err := tor.NewTorACNWithAuth(appDir, torPath, controlPort, tor.HashedPasswordAuthenticator{Password: base64.StdEncoding.EncodeToString(key)}) if err != nil { log.Errorf("Error connecting to Tor replacing with ErrorACN: %v\n", err) @@ -212,14 +230,14 @@ func ReconnectCwtchForeground() { } // populate profile list - peerList := application.ListPeers() - for onion := range peerList { + peerList := application.ListProfiles() + for _, onion := range peerList { eventHandler.Push(event.NewEvent(event.NewPeer, map[event.Field]string{event.Identity: onion, event.Created: event.False, "Reload": event.True})) } settings := utils.ReadGlobalSettings() - for profileOnion := range peerList { + for _, profileOnion := range peerList { // fix peerpeercontact message counts contactList := application.GetPeer(profileOnion).GetContacts() for _, handle := range contactList { @@ -289,7 +307,7 @@ func SendAppEvent(eventJson string) { // Group Experiment Refresh groupHandler, err := groups.ExperimentGate(utils.ReadGlobalSettings().Experiments) if err == nil { - for profileOnion := range application.ListPeers() { + for _, profileOnion := range application.ListProfiles() { serverListForOnion := groupHandler.GetServerInfoList(application.GetPeer(profileOnion)) serversListBytes, _ := json.Marshal(serverListForOnion) eventHandler.Push(event.NewEvent(groups.UpdateServerInfo, map[event.Field]string{"ProfileOnion": profileOnion, groups.ServerList: string(serversListBytes)})) @@ -299,18 +317,18 @@ func SendAppEvent(eventJson string) { // Explicitly toggle blocking/unblocking of unknown connections for profiles // that have been loaded. if utils.ReadGlobalSettings().BlockUnknownConnections { - for onion := range application.ListPeers() { + for _, onion := range application.ListProfiles() { application.GetPeer(onion).BlockUnknownConnections() } } else { - for onion := range application.ListPeers() { + for _, onion := range application.ListProfiles() { application.GetPeer(onion).AllowUnknownConnections() } } case utils.SetLoggingLevel: _, warn := new_event.Data[utils.Warn] - _, error := new_event.Data[utils.Error] + _, err := new_event.Data[utils.Error] _, debug := new_event.Data[utils.Debug] _, info := new_event.Data[utils.Info] // Assign logging level in priority order. The highest logging level wins in the @@ -319,7 +337,7 @@ func SendAppEvent(eventJson string) { log.SetLevel(log.LevelInfo) } else if warn { log.SetLevel(log.LevelWarn) - } else if error { + } else if err { log.SetLevel(log.LevelError) } else if debug { log.SetLevel(log.LevelDebug) @@ -366,7 +384,7 @@ func SendProfileEvent(onion string, eventJson string) { eventHandler.Push(event.NewEvent(event.AppError, map[event.Field]string{event.Data: err.Error()})) // DEPRECATED: use SetProfileAttribute() case event.SetAttribute: - peer.SetAttribute(new_event.Data[event.Key], new_event.Data[event.Data]) + log.Errorf("SetAttribute is deprecated.") // DEPRECATED: use SetContactAttribute() case event.SetPeerAttribute: peer.SetContactAttribute(new_event.Data[event.RemotePeer], new_event.Data[event.Key], new_event.Data[event.Data]) @@ -405,12 +423,6 @@ func GetAppBusEvent() string { return json } -type Profile struct { - Name string `json:"name"` - Onion string `json:"onion"` - ImagePath string `json:"imagePath"` -} - //export c_CreateProfile func c_CreateProfile(nick_ptr *C.char, nick_len C.int, pass_ptr *C.char, pass_len C.int) { CreateProfile(C.GoStringN(nick_ptr, nick_len), C.GoStringN(pass_ptr, pass_len)) @@ -672,17 +684,20 @@ func SendInvitation(profileOnion, handle, target string) { func c_ShareFile(profile_ptr *C.char, profile_len C.int, handle_ptr *C.char, handle_len C.int, filepath_ptr *C.char, filepath_len C.int) { profile := C.GoStringN(profile_ptr, profile_len) handle := C.GoStringN(handle_ptr, handle_len) - filepath := C.GoStringN(filepath_ptr, filepath_len) - ShareFile(profile, handle, filepath) + sharefilepath := C.GoStringN(filepath_ptr, filepath_len) + ShareFile(profile, handle, sharefilepath) } -func ShareFile(profileOnion, handle, filepath string) { +func ShareFile(profileOnion, handle, sharefilepath string) { profile := application.GetPeer(profileOnion) fh, err := filesharing.FunctionalityGate(utils.ReadGlobalSettings().Experiments) if err != nil { log.Errorf("file sharing error: %v", err) } else { - fh.ShareFile(filepath, profile, handle) + err = fh.ShareFile(sharefilepath, profile, handle) + if err != nil { + log.Errorf("error sharing file: %v", err) + } } } @@ -690,10 +705,10 @@ func ShareFile(profileOnion, handle, filepath string) { func c_DownloadFile(profile_ptr *C.char, profile_len C.int, handle_ptr *C.char, handle_len C.int, filepath_ptr *C.char, filepath_len C.int, manifestpath_ptr *C.char, manifestpath_len C.int, filekey_ptr *C.char, filekey_len C.int) { profile := C.GoStringN(profile_ptr, profile_len) handle := C.GoStringN(handle_ptr, handle_len) - filepath := C.GoStringN(filepath_ptr, filepath_len) + downloadfilepath := C.GoStringN(filepath_ptr, filepath_len) manifestpath := C.GoStringN(manifestpath_ptr, manifestpath_len) filekey := C.GoStringN(filekey_ptr, filekey_len) - DownloadFile(profile, handle, filepath, manifestpath, filekey) + DownloadFile(profile, handle, downloadfilepath, manifestpath, filekey) } func DownloadFile(profileOnion, handle, filepath, manifestpath, filekey string) { @@ -713,7 +728,7 @@ func c_CheckDownloadStatus(profilePtr *C.char, profileLen C.int, fileKeyPtr *C.c func CheckDownloadStatus(profileOnion, fileKey string) { profile := application.GetPeer(profileOnion) - if path, exists := profile.GetAttribute(attr.GetLocalScope(fileKey)); exists { + if path, exists := profile.GetScopedZonedAttribute(attr.LocalScope, attr.FilesharingZone, fileKey); exists { eventHandler.Push(event.NewEvent(event.FileDownloaded, map[event.Field]string{ ProfileOnion: profileOnion, event.FileKey: fileKey, @@ -741,17 +756,17 @@ func c_CreateGroup(profile_ptr *C.char, profile_len C.int, server_ptr *C.char, s } // CreateGroup takes in a profile and server in addition to a name and creates a new group. -func CreateGroup(profile string, server string, name string) { - peer := application.GetPeer(profile) +func CreateGroup(profileHandle string, server string, name string) { + profile := application.GetPeer(profileHandle) _, err := groups.ExperimentGate(utils.ReadGlobalSettings().Experiments) if err == nil { - gid, _, err := peer.StartGroup(server) + gid, _, err := profile.StartGroup(server) if err == nil { - log.Debugf("created group %v on %v: $v", profile, server, gid) + log.Debugf("created group %v on %v: $v", profileHandle, server, gid) // set the group name - peer.SetGroupAttribute(gid, attr.GetLocalScope("name"), name) + profile.SetGroupAttribute(gid, attr.GetLocalScope("name"), name) } else { - log.Errorf("error creating group or %v on server %v: %v", profile, server, err) + log.Errorf("error creating group or %v on server %v: %v", profileHandle, server, err) } } } @@ -775,20 +790,20 @@ func DeleteProfile(profile string, password string) { } //export c_ArchiveConversation -func c_ArchiveConversation(profile_ptr *C.char, profile_len C.int, contact_ptr *C.char, contact_len C.int) { +func c_ArchiveConversation(profile_ptr *C.char, profile_len C.int, handle_ptr *C.char, handle_len C.int) { profile := C.GoStringN(profile_ptr, profile_len) - contact := C.GoStringN(contact_ptr, contact_len) - ArchiveConversation(profile, contact) + handle := C.GoStringN(handle_ptr, handle_len) + ArchiveConversation(profile, handle) } // ArchiveConversation sets the conversation to archived -func ArchiveConversation(profile string, handle string) { - peer := application.GetPeer(profile) - ph := utils.NewPeerHelper(peer) +func ArchiveConversation(profileHandle string, handle string) { + profile := application.GetPeer(profileHandle) + ph := utils.NewPeerHelper(profile) if ph.IsGroup(handle) { - peer.SetGroupAttribute(handle, attr.GetLocalScope(constants.Archived), event.True) + profile.SetGroupAttribute(handle, attr.GetLocalScope(constants.Archived), event.True) } else { - peer.SetContactAttribute(handle, attr.GetLocalScope(constants.Archived), event.True) + profile.SetContactAttribute(handle, attr.GetLocalScope(constants.Archived), event.True) } } @@ -800,16 +815,16 @@ func c_DeleteContact(profile_ptr *C.char, profile_len C.int, hanlde_ptr *C.char, } // DeleteContact removes all trace of the contact from the profile -func DeleteContact(profile string, handle string) { - peer := application.GetPeer(profile) - ph := utils.NewPeerHelper(peer) +func DeleteContact(profileHandle string, handle string) { + profile := application.GetPeer(profileHandle) + ph := utils.NewPeerHelper(profile) if ph.IsGroup(handle) { _, err := groups.ExperimentGate(utils.ReadGlobalSettings().Experiments) if err == nil { - peer.DeleteGroup(handle) + profile.DeleteGroup(handle) } } else { - peer.DeleteContact(handle) + profile.DeleteContact(handle) } } @@ -850,10 +865,23 @@ func c_SetProfileAttribute(profile_ptr *C.char, profile_len C.int, key_ptr *C.ch SetProfileAttribute(profileOnion, key, value) } -// SetProfileAttribute provides a wrapper around profile.SetAttribute +// SetProfileAttribute provides a wrapper around profile.SetScopedZonedAttribute +// WARNING: Because this function is potentially dangerous all keys and zones must be added +// explicitly. If you are attempting to added behaviour to the UI that requires the existence of new keys +// you probably want to be building out functionality/subsystem in the UI itself. +// Key must have the format zone.key where Zone is defined in Cwtch. Unknown zones are not permitted. func SetProfileAttribute(profileOnion string, key string, value string) { profile := application.GetPeer(profileOnion) - profile.SetAttribute(key, value) + + zone, key := attr.ParseZone(key) + + // TODO We only allow public.profile.zone to be set for now. + // All other scopes and zones need to be added explicitly or handled by Cwtch. + if zone == attr.ProfileZone && key == constants.Name { + profile.SetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants.Name, value) + } else { + log.Errorf("attempted to set an attribute with an unknown zone: %v", key) + } } //export c_SetContactAttribute diff --git a/utils/eventHandler.go b/utils/eventHandler.go index 931dc33..db5baa5 100644 --- a/utils/eventHandler.go +++ b/utils/eventHandler.go @@ -5,9 +5,10 @@ import ( "cwtch.im/cwtch/app/plugins" "cwtch.im/cwtch/model" "cwtch.im/cwtch/model/attr" + "cwtch.im/cwtch/model/constants" "cwtch.im/cwtch/protocol/connections" "encoding/json" - "git.openprivacy.ca/cwtch.im/libcwtch-go/constants" + constants2 "git.openprivacy.ca/cwtch.im/libcwtch-go/constants" "git.openprivacy.ca/cwtch.im/libcwtch-go/features/groups" "git.openprivacy.ca/openprivacy/log" "strconv" @@ -68,7 +69,7 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { switch e.EventType { case event.ACNStatus: if e.Data[event.Progress] == "100" { - for onion := range eh.app.ListPeers() { + for _, onion := range eh.app.ListProfiles() { // launch a listen thread (internally this does a check that the protocol engine is not listening) // and as such is safe to call. eh.app.GetPeer(onion).Listen() @@ -83,22 +84,15 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { eh.startHandlingPeer(onion) } - tag, isTagged := profile.GetAttribute(app.AttributeTag) - if isTagged { - e.Data[app.AttributeTag] = tag - } else { - // Assume encrypted for non-tagged profiles - this isn't always true, but all post-beta profiles - // are tagged on creation. - e.Data[app.AttributeTag] = constants.ProfileTypeV1Password - } + // CwtchPeer will always set this now... + tag, _ := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants.Tag) + e.Data[constants.Tag] = tag if e.Data[event.Created] == event.True { - name, _ := profile.GetAttribute(attr.GetLocalScope(constants.Name)) - profile.SetAttribute(attr.GetPublicScope(constants.Name), name) - profile.SetAttribute(attr.GetPublicScope(constants.Picture), ImageToString(NewImage(RandomProfileImage(onion), TypeImageDistro))) + profile.SetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants2.Picture, ImageToString(NewImage(RandomProfileImage(onion), TypeImageDistro))) } if e.Data[event.Status] != event.StorageRunning || e.Data[event.Created] == event.True { - profile.SetAttribute(attr.GetLocalScope(constants.PeerOnline), event.False) + profile.SetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline, event.False) eh.app.AddPeerPlugin(onion, plugins.CONNECTIONRETRY) eh.app.AddPeerPlugin(onion, plugins.NETWORKCHECK) @@ -119,12 +113,7 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { } } - nick, exists := profile.GetAttribute(attr.GetPublicScope(constants.Name)) - if !exists { - nick = onion - } - - picVal, ok := profile.GetAttribute(attr.GetPublicScope(constants.Picture)) + picVal, ok := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.Picture) if !ok { picVal = ImageToString(NewImage(RandomProfileImage(onion), TypeImageDistro)) } @@ -134,12 +123,14 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { } picPath := GetPicturePath(pic) - //tag, _ := profile.GetAttribute(app.AttributeTag) + // Set publicly scopes attributes + profile.SetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants2.Picture, picPath) - online, _ := profile.GetAttribute(attr.GetLocalScope(constants.PeerOnline)) + online, _ := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline) - e.Data[constants.Name] = nick - e.Data[constants.Picture] = picPath + // Name always exists + e.Data[constants.Name], _ = profile.GetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants.Name) + e.Data[constants2.Picture] = picPath e.Data["Online"] = online var contacts []Contact @@ -166,7 +157,7 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { if !set { saveHistory = event.DeleteHistoryDefault } - isArchived, set := contactInfo.GetAttribute(attr.GetLocalScope(constants.Archived)) + isArchived, set := contactInfo.GetAttribute(attr.GetLocalScope(constants2.Archived)) if !set { isArchived = event.False } @@ -201,7 +192,7 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { if group.Accepted { authorization = model.AuthApproved } - isArchived, set := group.GetAttribute(attr.GetLocalScope(constants.Archived)) + isArchived, set := group.GetAttribute(attr.GetLocalScope(constants2.Archived)) if !set { isArchived = event.False } @@ -266,12 +257,12 @@ func (eh *EventHandler) handleProfileEvent(ev *EventProfileEnvelope) string { // only needs contact nickname and picture, for displaying on popup notifications ev.Event.Data["Nick"] = ph.GetNick(ev.Event.Data["RemotePeer"]) ev.Event.Data["Picture"] = ph.GetProfilePic(ev.Event.Data["RemotePeer"]) - peer.SetContactAttribute(ev.Event.Data["RemotePeer"], attr.GetLocalScope(constants.Archived), event.False) + peer.SetContactAttribute(ev.Event.Data["RemotePeer"], attr.GetLocalScope(constants2.Archived), event.False) case event.NewMessageFromGroup: // only needs contact nickname and picture, for displaying on popup notifications ev.Event.Data["Nick"] = ph.GetNick(ev.Event.Data[event.GroupID]) ev.Event.Data["Picture"] = ph.GetProfilePic(ev.Event.Data[event.GroupID]) - peer.SetGroupAttribute(ev.Event.Data[event.GroupID], attr.GetLocalScope(constants.Archived), event.False) + peer.SetGroupAttribute(ev.Event.Data[event.GroupID], attr.GetLocalScope(constants2.Archived), event.False) case event.PeerAcknowledgement: // No enrichement required case event.PeerCreated: @@ -313,8 +304,8 @@ func (eh *EventHandler) handleProfileEvent(ev *EventProfileEnvelope) string { //uiManager.UpdateContactStatus(contact.Onion, int(cxnState), false) if cxnState == connections.AUTHENTICATED { // if known and authed, get vars - peer.SendGetValToPeer(ev.Event.Data[event.RemotePeer], attr.PublicScope, constants.Name) - peer.SendGetValToPeer(ev.Event.Data[event.RemotePeer], attr.PublicScope, constants.Picture) + peer.SendScopedZonedGetValToContact(ev.Event.Data[event.RemotePeer], attr.PublicScope, attr.ProfileZone, constants.Name) + peer.SendScopedZonedGetValToContact(ev.Event.Data[event.RemotePeer], attr.PublicScope, attr.ProfileZone, constants2.Picture) } } @@ -326,9 +317,9 @@ func (eh *EventHandler) handleProfileEvent(ev *EventProfileEnvelope) string { //val := ev.Event.Data[event.Data] exists, _ := strconv.ParseBool(ev.Event.Data[event.Exists]) - if exists && scope == attr.PublicScope { + if exists && attr.IntoScope(scope) == attr.PublicScope { if _, exists := peer.GetContactAttribute(onion, attr.GetLocalScope(path)); exists { - // we have a locally set ovverride, don't pass this remote set public scope update to UI + // we have a locally set override, don't pass this remote set public scope update to UI return "" } } diff --git a/utils/manager.go b/utils/manager.go index f87d943..4e2ea8e 100644 --- a/utils/manager.go +++ b/utils/manager.go @@ -114,7 +114,7 @@ func (p *PeerHelper) GetNick(id string) string { // re-request if authenticated // TODO: This check probably doesn't belong here... if contact := p.peer.GetContact(id); contact != nil && contact.State == connections.ConnectionStateName[connections.AUTHENTICATED] { - p.peer.SendGetValToPeer(id, attr.PublicScope, constants.Name) + p.peer.SendScopedZonedGetValToContact(id, attr.PublicScope, attr.ProfileZone, constants.Name) } } }