whatsapp: check comply, make native built default

This commit is contained in:
Mark Joshwel 2024-06-19 01:31:35 +08:00
parent 85f305fb78
commit ad5707408c
2 changed files with 14 additions and 12 deletions

View file

@ -224,9 +224,11 @@ func parseJID(arg string) (types.JID, bool) {
if arg[0] == '+' { if arg[0] == '+' {
arg = arg[1:] arg = arg[1:]
} }
if !strings.ContainsRune(arg, '@') { if !strings.ContainsRune(arg, '@') {
return types.NewJID(arg, types.DefaultUserServer), true return types.NewJID(arg, types.DefaultUserServer), true
} else { }
recipient, err := types.ParseJID(arg) recipient, err := types.ParseJID(arg)
if err != nil { if err != nil {
log.Errorf("s+ow-whatsapp-bridge: Invalid JID %s: %v", arg, err) log.Errorf("s+ow-whatsapp-bridge: Invalid JID %s: %v", arg, err)
@ -237,7 +239,6 @@ func parseJID(arg string) (types.JID, bool) {
} }
return recipient, true return recipient, true
} }
}
func handleCmd(cmd string, args []string) { func handleCmd(cmd string, args []string) {
// s+ow-whatsapp-bridge: we only need the bare minimum: // s+ow-whatsapp-bridge: we only need the bare minimum:

View file

@ -83,6 +83,7 @@
devShells.default = mkShell { devShells.default = mkShell {
buildInputs = [ buildInputs = [
go go
golint
gomod2nix.packages.${system}.default gomod2nix.packages.${system}.default
]; ];
}; };
@ -99,8 +100,8 @@
''; '';
}; };
# nix build .#native # nix build
packages.native = stdenvNoCC.mkDerivation { packages.default = stdenvNoCC.mkDerivation {
pname = bridge.name; pname = bridge.name;
version = bridge.version; version = bridge.version;
src = bridgeBuildNative; src = bridgeBuildNative;