Refine Start Group Event + Auto Accept Self-created Groups
This commit is contained in:
parent
7b9c9de9b6
commit
fbd1f98b65
|
@ -51,7 +51,7 @@ func NewGroup(server string) (*Group, error) {
|
|||
group := new(Group)
|
||||
group.Version = CurrentGroupVersion
|
||||
group.LocalID = GenerateRandomID()
|
||||
|
||||
group.Accepted = true // we are starting a group, so we assume we want to connect to it...
|
||||
if tor.IsValidHostname(server) == false {
|
||||
return nil, errors.New("Server is not a valid v3 onion")
|
||||
}
|
||||
|
|
|
@ -250,6 +250,10 @@ func (cp *cwtchPeer) StartGroup(server string) (string, string, error) {
|
|||
jsobj, err := json.Marshal(group)
|
||||
if err == nil {
|
||||
cp.eventBus.Publish(event.NewEvent(event.GroupCreated, map[event.Field]string{
|
||||
event.GroupID: groupID,
|
||||
event.GroupServer: group.GroupServer,
|
||||
event.GroupInvite: invite,
|
||||
// Needed for Storage Engine...
|
||||
event.Data: string(jsobj),
|
||||
}))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue