diff --git a/src/spow-whatsapp-bridge/bridge.go b/src/spow-whatsapp-bridge/bridge.go index 5272b32..624d2dd 100644 --- a/src/spow-whatsapp-bridge/bridge.go +++ b/src/spow-whatsapp-bridge/bridge.go @@ -224,19 +224,20 @@ func parseJID(arg string) (types.JID, bool) { if arg[0] == '+' { arg = arg[1:] } + if !strings.ContainsRune(arg, '@') { return types.NewJID(arg, types.DefaultUserServer), true - } else { - recipient, err := types.ParseJID(arg) - if err != nil { - log.Errorf("s+ow-whatsapp-bridge: Invalid JID %s: %v", arg, err) - return recipient, false - } else if recipient.User == "" { - log.Errorf("s+ow-whatsapp-bridge: Invalid JID %s: no server specified", arg) - return recipient, false - } - return recipient, true } + + recipient, err := types.ParseJID(arg) + if err != nil { + log.Errorf("s+ow-whatsapp-bridge: Invalid JID %s: %v", arg, err) + return recipient, false + } else if recipient.User == "" { + log.Errorf("s+ow-whatsapp-bridge: Invalid JID %s: no server specified", arg) + return recipient, false + } + return recipient, true } func handleCmd(cmd string, args []string) { diff --git a/src/spow-whatsapp-bridge/flake.nix b/src/spow-whatsapp-bridge/flake.nix index ba5ef94..c99bb16 100644 --- a/src/spow-whatsapp-bridge/flake.nix +++ b/src/spow-whatsapp-bridge/flake.nix @@ -83,6 +83,7 @@ devShells.default = mkShell { buildInputs = [ go + golint gomod2nix.packages.${system}.default ]; }; @@ -99,8 +100,8 @@ ''; }; - # nix build .#native - packages.native = stdenvNoCC.mkDerivation { + # nix build + packages.default = stdenvNoCC.mkDerivation { pname = bridge.name; version = bridge.version; src = bridgeBuildNative;