Integrate Group Name into Invite #336

Merged
dan merged 1 commits from group_create_ui into master 2020-12-17 05:54:03 +00:00
Owner
No description provided.
dan was assigned by sarah 2020-12-17 03:13:11 +00:00
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/932
dan requested changes 2020-12-17 05:35:49 +00:00
model/group.go Outdated
@ -97,2 +101,3 @@
gci := &groups.GroupInvite{
GroupName: g.GroupID,
GroupID: g.GroupID,
GroupName: g.Attributes[attr.GetLocalScope("name")],
Owner

for ease and safety of reuseability from clients, might want to replace "name" with a const in model/group.go ... Name

for ease and safety of reuseability from clients, might want to replace "name" with a const in model/group.go ... Name
Author
Owner

This needs a wider rethink as we are technically crossing boundaries here already, and duplicating constants isn't the right approach - we either should extract this code out or move the UI code back.

This needs a wider rethink as we are technically crossing boundaries here already, and duplicating constants isn't the right approach - we either should extract this code out or move the UI code back.
model/profile.go Outdated
@ -378,1 +379,4 @@
group.Attributes = make(map[string]string)
// NOTE: this path technically only exists in UI, either we should move this code into the UI or a separate library
// or move those attrs back to Cwtch lib...but for now this is a nicety.
group.Attributes[attr.GetLocalScope("name")] = gci.GroupName
Owner

should use SetAttribute() which uses p.lock.Lock() (ProcessInvite mostly just operates on args, doesnt touch the Profile, except fotthe call to AddGroup, which also uses the lock

should use SetAttribute() which uses p.lock.Lock() (ProcessInvite mostly just operates on args, doesnt touch the Profile, except fotthe call to AddGroup, which also uses the lock
Author
Owner

Ah yeah I wrote this code before writing the other code that actually does what you suggest and is in this PR...will delete.

Ah yeah I wrote this code before writing the other code that actually does what you suggest and is in this PR...will delete.
@ -295,2 +296,4 @@
}
// GetServers returns an unordered list of servers
func (cp *cwtchPeer) GetServers() []string {
Owner

cp.mutex.Lock()
defer cp.mutex.Unlock()

at the start

cp.mutex.Lock() defer cp.mutex.Unlock() at the start
Author
Owner

This would cause a deadlock because this only calls other peer functions.

This would cause a deadlock because this only calls other peer functions.
@ -83,2 +83,4 @@
log.Infof("Server Config: server:%s", base64.StdEncoding.EncodeToString(bundle))
server.Run(acn)
for {
time.Sleep(time.Second)
Owner

hahahha oph...

hahahha oph...
Author
Owner

Not technically part of this PR but it works better...needs a complete rework, but out of scope.

Not technically part of this PR but it works better...needs a complete rework, but out of scope.
@ -53,3 +53,3 @@
/********************************************************************************************/
// AddGroup For testing, adds a group to the profile (and startsa stream store)
// AddGroup For testing, adds a group to the profile (and starts a stream store)
Owner

this is legacy v0 storage engine, just for loading old saves in order to upgrad them to v1

AddGroup here can just be (and should be deleted) rather than updated to post v0 model changes. As the models it imports change... unless we make a model/v0 ... it's window of usability dwindles anyways

this is legacy v0 storage engine, just for loading old saves in order to upgrad them to v1 AddGroup here can just be (and should be deleted) rather than updated to post v0 model changes. As the models it imports change... unless we make a model/v0 ... it's window of usability dwindles anyways
Author
Owner

Moving this to an issue, since deprecation is a separate concern.

Moving this to an issue, since deprecation is a separate concern.
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/934
dan merged commit 94b47d213f into master 2020-12-17 05:54:02 +00:00
Sign in to join this conversation.
No description provided.