From eb570745a52f3eae143797d4af59470bf334fb33 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 16 Mar 2021 13:55:50 -0700 Subject: [PATCH] Formatt + if/else --- features/groups/group_functionality.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/features/groups/group_functionality.go b/features/groups/group_functionality.go index 2f17e2d..8ce5f7a 100644 --- a/features/groups/group_functionality.go +++ b/features/groups/group_functionality.go @@ -54,19 +54,15 @@ func (gf *GroupFunctionality) HandleImportString(peer peer.CwtchPeer, importStri gf.HandleImportString(peer, bundle[0][11:]) gf.HandleImportString(peer, bundle[1]) return nil - } - - // Server Key Bundles are prefixed with - if strings.HasPrefix(importString, ServerPrefix) { + } else if strings.HasPrefix(importString, ServerPrefix) { + // Server Key Bundles are prefixed with bundle, err := base64.StdEncoding.DecodeString(importString[7:]) if err == nil { return peer.AddServer(string(bundle)) } return err - } - - //eg: torv3JFDWkXExBsZLkjvfkkuAxHsiLGZBk0bvoeJID9ItYnU=EsEBCiBhOWJhZDU1OTQ0NWI3YmM2N2YxYTM5YjkzMTNmNTczNRIgpHeNaG+6jy750eDhwLO39UX4f2xs0irK/M3P6mDSYQIaOTJjM2ttb29ibnlnaGoyenc2cHd2N2Q1N3l6bGQ3NTNhdW8zdWdhdWV6enB2ZmFrM2FoYzRiZHlkCiJAdVSSVgsksceIfHe41OJu9ZFHO8Kwv3G6F5OK3Hw4qZ6hn6SiZjtmJlJezoBH0voZlCahOU7jCOg+dsENndZxAA== - if strings.HasPrefix(importString, GroupPrefix) { + } else if strings.HasPrefix(importString, GroupPrefix) { + //eg: torv3JFDWkXExBsZLkjvfkkuAxHsiLGZBk0bvoeJID9ItYnU=EsEBCiBhOWJhZDU1OTQ0NWI3YmM2N2YxYTM5YjkzMTNmNTczNRIgpHeNaG+6jy750eDhwLO39UX4f2xs0irK/M3P6mDSYQIaOTJjM2ttb29ibnlnaGoyenc2cHd2N2Q1N3l6bGQ3NTNhdW8zdWdhdWV6enB2ZmFrM2FoYzRiZHlkCiJAdVSSVgsksceIfHe41OJu9ZFHO8Kwv3G6F5OK3Hw4qZ6hn6SiZjtmJlJezoBH0voZlCahOU7jCOg+dsENndZxAA== return peer.ImportGroup(importString) }