From 3418e8c9afbdf3e94ab26a20d8f12c042ae29fc4 Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 30 May 2019 12:20:56 +0200 Subject: Use upstream whatsapp again (#809) --- bridge/whatsapp/handlers.go | 4 +- bridge/whatsapp/helpers.go | 2 +- bridge/whatsapp/whatsapp.go | 7 +- go.mod | 6 +- go.sum | 22 +- vendor/github.com/Rhymen/go-whatsapp/.gitignore | 3 + vendor/github.com/Rhymen/go-whatsapp/LICENSE | 21 + vendor/github.com/Rhymen/go-whatsapp/README.md | 104 + .../Rhymen/go-whatsapp/binary/decoder.go | 388 ++ .../Rhymen/go-whatsapp/binary/encoder.go | 351 ++ .../github.com/Rhymen/go-whatsapp/binary/node.go | 103 + .../Rhymen/go-whatsapp/binary/proto/def.pb.go | 3800 ++++++++++++++++++++ .../Rhymen/go-whatsapp/binary/proto/def.proto | 417 +++ .../Rhymen/go-whatsapp/binary/token/token.go | 78 + vendor/github.com/Rhymen/go-whatsapp/conn.go | 210 ++ vendor/github.com/Rhymen/go-whatsapp/contact.go | 234 ++ .../Rhymen/go-whatsapp/crypto/cbc/cbc.go | 101 + .../Rhymen/go-whatsapp/crypto/curve25519/curve.go | 44 + .../Rhymen/go-whatsapp/crypto/hkdf/hkdf.go | 52 + vendor/github.com/Rhymen/go-whatsapp/errors.go | 35 + vendor/github.com/Rhymen/go-whatsapp/go.mod | 8 + vendor/github.com/Rhymen/go-whatsapp/go.sum | 14 + vendor/github.com/Rhymen/go-whatsapp/group.go | 90 + vendor/github.com/Rhymen/go-whatsapp/handler.go | 191 + vendor/github.com/Rhymen/go-whatsapp/media.go | 199 + vendor/github.com/Rhymen/go-whatsapp/message.go | 444 +++ vendor/github.com/Rhymen/go-whatsapp/read.go | 111 + vendor/github.com/Rhymen/go-whatsapp/session.go | 450 +++ vendor/github.com/Rhymen/go-whatsapp/store.go | 45 + vendor/github.com/Rhymen/go-whatsapp/write.go | 125 + vendor/github.com/golang/protobuf/proto/decode.go | 1 - .../github.com/golang/protobuf/proto/deprecated.go | 63 + vendor/github.com/golang/protobuf/proto/equal.go | 3 +- .../github.com/golang/protobuf/proto/extensions.go | 78 +- vendor/github.com/golang/protobuf/proto/lib.go | 38 +- .../golang/protobuf/proto/message_set.go | 137 +- .../golang/protobuf/proto/pointer_reflect.go | 5 +- .../golang/protobuf/proto/pointer_unsafe.go | 15 +- .../github.com/golang/protobuf/proto/properties.go | 31 +- .../golang/protobuf/proto/table_marshal.go | 45 +- .../golang/protobuf/proto/table_unmarshal.go | 72 +- .../protoc-gen-go/descriptor/descriptor.pb.go | 603 ++-- .../protoc-gen-go/descriptor/descriptor.proto | 11 + .../github.com/matterbridge/go-whatsapp/.gitignore | 2 - vendor/github.com/matterbridge/go-whatsapp/LICENSE | 21 - .../github.com/matterbridge/go-whatsapp/README.md | 104 - .../matterbridge/go-whatsapp/binary/decoder.go | 388 -- .../matterbridge/go-whatsapp/binary/encoder.go | 351 -- .../matterbridge/go-whatsapp/binary/node.go | 103 - .../go-whatsapp/binary/proto/def.pb.go | 3800 -------------------- .../go-whatsapp/binary/proto/def.proto | 417 --- .../matterbridge/go-whatsapp/binary/token/token.go | 78 - vendor/github.com/matterbridge/go-whatsapp/conn.go | 389 -- .../github.com/matterbridge/go-whatsapp/contact.go | 234 -- .../matterbridge/go-whatsapp/crypto/cbc/cbc.go | 101 - .../go-whatsapp/crypto/curve25519/curve.go | 44 - .../matterbridge/go-whatsapp/crypto/hkdf/hkdf.go | 52 - vendor/github.com/matterbridge/go-whatsapp/go.mod | 8 - vendor/github.com/matterbridge/go-whatsapp/go.sum | 7 - .../github.com/matterbridge/go-whatsapp/group.go | 65 - .../github.com/matterbridge/go-whatsapp/handler.go | 169 - .../github.com/matterbridge/go-whatsapp/media.go | 199 - .../github.com/matterbridge/go-whatsapp/message.go | 444 --- .../github.com/matterbridge/go-whatsapp/session.go | 389 -- .../github.com/matterbridge/go-whatsapp/store.go | 45 - .../matterbridge/mautrix-whatsapp/LICENSE | 661 ---- .../mautrix-whatsapp/whatsapp-ext/chat.go | 147 - .../mautrix-whatsapp/whatsapp-ext/cmd.go | 59 - .../mautrix-whatsapp/whatsapp-ext/conn.go | 60 - .../mautrix-whatsapp/whatsapp-ext/jsonmessage.go | 102 - .../mautrix-whatsapp/whatsapp-ext/msginfo.go | 90 - .../mautrix-whatsapp/whatsapp-ext/presence.go | 67 - .../mautrix-whatsapp/whatsapp-ext/props.go | 68 - .../mautrix-whatsapp/whatsapp-ext/stream.go | 63 - .../mautrix-whatsapp/whatsapp-ext/whatsapp.go | 132 - vendor/github.com/pkg/errors/.travis.yml | 12 +- vendor/github.com/pkg/errors/README.md | 4 +- vendor/github.com/pkg/errors/errors.go | 43 +- vendor/github.com/pkg/errors/stack.go | 51 +- .../x/crypto/internal/chacha20/chacha_s390x.go | 11 +- .../x/crypto/internal/chacha20/chacha_s390x.s | 23 - vendor/golang.org/x/crypto/poly1305/mac_noasm.go | 11 + vendor/golang.org/x/crypto/poly1305/poly1305.go | 80 +- vendor/golang.org/x/crypto/poly1305/sum_amd64.go | 58 +- vendor/golang.org/x/crypto/poly1305/sum_amd64.s | 63 +- vendor/golang.org/x/crypto/poly1305/sum_generic.go | 172 + vendor/golang.org/x/crypto/poly1305/sum_noasm.go | 4 +- vendor/golang.org/x/crypto/poly1305/sum_ref.go | 139 - vendor/golang.org/x/crypto/poly1305/sum_s390x.go | 17 +- vendor/golang.org/x/crypto/poly1305/sum_s390x.s | 22 - .../golang.org/x/crypto/poly1305/sum_vmsl_s390x.s | 22 - .../x/crypto/ssh/terminal/util_windows.go | 6 +- vendor/golang.org/x/sys/cpu/byteorder.go | 30 + vendor/golang.org/x/sys/cpu/cpu.go | 89 + vendor/golang.org/x/sys/cpu/cpu_arm.go | 9 + vendor/golang.org/x/sys/cpu/cpu_gc_x86.go | 16 + vendor/golang.org/x/sys/cpu/cpu_gccgo.c | 43 + vendor/golang.org/x/sys/cpu/cpu_gccgo.go | 26 + vendor/golang.org/x/sys/cpu/cpu_linux.go | 55 + vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go | 67 + vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go | 33 + vendor/golang.org/x/sys/cpu/cpu_mips64x.go | 11 + vendor/golang.org/x/sys/cpu/cpu_mipsx.go | 11 + vendor/golang.org/x/sys/cpu/cpu_other_arm64.go | 11 + vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go | 12 + vendor/golang.org/x/sys/cpu/cpu_s390x.go | 9 + vendor/golang.org/x/sys/cpu/cpu_x86.go | 57 + vendor/golang.org/x/sys/cpu/cpu_x86.s | 27 + vendor/maunium.net/go/mautrix-whatsapp/LICENSE | 661 ++++ .../go/mautrix-whatsapp/whatsapp-ext/chat.go | 147 + .../go/mautrix-whatsapp/whatsapp-ext/cmd.go | 59 + .../go/mautrix-whatsapp/whatsapp-ext/conn.go | 60 + .../mautrix-whatsapp/whatsapp-ext/jsonmessage.go | 102 + .../go/mautrix-whatsapp/whatsapp-ext/msginfo.go | 90 + .../go/mautrix-whatsapp/whatsapp-ext/presence.go | 67 + .../go/mautrix-whatsapp/whatsapp-ext/props.go | 68 + .../go/mautrix-whatsapp/whatsapp-ext/stream.go | 63 + .../go/mautrix-whatsapp/whatsapp-ext/whatsapp.go | 132 + vendor/modules.txt | 27 +- 119 files changed, 10614 insertions(+), 9726 deletions(-) create mode 100644 vendor/github.com/Rhymen/go-whatsapp/.gitignore create mode 100644 vendor/github.com/Rhymen/go-whatsapp/LICENSE create mode 100644 vendor/github.com/Rhymen/go-whatsapp/README.md create mode 100644 vendor/github.com/Rhymen/go-whatsapp/binary/decoder.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/binary/encoder.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/binary/node.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/binary/proto/def.pb.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/binary/proto/def.proto create mode 100644 vendor/github.com/Rhymen/go-whatsapp/binary/token/token.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/conn.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/contact.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/crypto/cbc/cbc.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/crypto/curve25519/curve.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/crypto/hkdf/hkdf.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/errors.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/go.mod create mode 100644 vendor/github.com/Rhymen/go-whatsapp/go.sum create mode 100644 vendor/github.com/Rhymen/go-whatsapp/group.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/handler.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/media.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/message.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/read.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/session.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/store.go create mode 100644 vendor/github.com/Rhymen/go-whatsapp/write.go create mode 100644 vendor/github.com/golang/protobuf/proto/deprecated.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/.gitignore delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/LICENSE delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/README.md delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/binary/decoder.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/binary/encoder.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/binary/node.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/binary/proto/def.pb.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/binary/proto/def.proto delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/binary/token/token.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/conn.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/contact.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/crypto/cbc/cbc.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/crypto/curve25519/curve.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/crypto/hkdf/hkdf.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/go.mod delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/go.sum delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/group.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/handler.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/media.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/message.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/session.go delete mode 100644 vendor/github.com/matterbridge/go-whatsapp/store.go delete mode 100644 vendor/github.com/matterbridge/mautrix-whatsapp/LICENSE delete mode 100644 vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/chat.go delete mode 100644 vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/cmd.go delete mode 100644 vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/conn.go delete mode 100644 vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/jsonmessage.go delete mode 100644 vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/msginfo.go delete mode 100644 vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/presence.go delete mode 100644 vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/props.go delete mode 100644 vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/stream.go delete mode 100644 vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/whatsapp.go create mode 100644 vendor/golang.org/x/crypto/poly1305/mac_noasm.go create mode 100644 vendor/golang.org/x/crypto/poly1305/sum_generic.go delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_ref.go create mode 100644 vendor/golang.org/x/sys/cpu/byteorder.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_x86.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo.c create mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_mips64x.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_mipsx.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_arm64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_s390x.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_x86.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_x86.s create mode 100644 vendor/maunium.net/go/mautrix-whatsapp/LICENSE create mode 100644 vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/chat.go create mode 100644 vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/cmd.go create mode 100644 vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/conn.go create mode 100644 vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/jsonmessage.go create mode 100644 vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/msginfo.go create mode 100644 vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/presence.go create mode 100644 vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/props.go create mode 100644 vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/stream.go create mode 100644 vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/whatsapp.go diff --git a/bridge/whatsapp/handlers.go b/bridge/whatsapp/handlers.go index d419ac20..456f2009 100644 --- a/bridge/whatsapp/handlers.go +++ b/bridge/whatsapp/handlers.go @@ -6,9 +6,9 @@ import ( "github.com/42wim/matterbridge/bridge/config" - "github.com/matterbridge/go-whatsapp" + "github.com/Rhymen/go-whatsapp" - whatsappExt "github.com/matterbridge/mautrix-whatsapp/whatsapp-ext" + whatsappExt "maunium.net/go/mautrix-whatsapp/whatsapp-ext" ) /* diff --git a/bridge/whatsapp/helpers.go b/bridge/whatsapp/helpers.go index d8743628..5268ba3e 100644 --- a/bridge/whatsapp/helpers.go +++ b/bridge/whatsapp/helpers.go @@ -6,7 +6,7 @@ import ( "os" qrcodeTerminal "github.com/Baozisoftware/qrcode-terminal-go" - "github.com/matterbridge/go-whatsapp" + "github.com/Rhymen/go-whatsapp" ) func qrFromTerminal(invert bool) chan string { diff --git a/bridge/whatsapp/whatsapp.go b/bridge/whatsapp/whatsapp.go index 286d463c..c66e13ac 100644 --- a/bridge/whatsapp/whatsapp.go +++ b/bridge/whatsapp/whatsapp.go @@ -11,10 +11,9 @@ import ( "github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge/config" + "github.com/Rhymen/go-whatsapp" - "github.com/matterbridge/go-whatsapp" - - whatsappExt "github.com/matterbridge/mautrix-whatsapp/whatsapp-ext" + whatsappExt "maunium.net/go/mautrix-whatsapp/whatsapp-ext" ) const ( @@ -89,7 +88,7 @@ func (b *Bwhatsapp) Connect() error { b.Log.Debugln("Restoring WhatsApp session..") // https://github.com/Rhymen/go-whatsapp#restore - session, err = b.conn.RestoreSession(session) + session, err = b.conn.RestoreWithSession(session) if err != nil { // TODO return or continue to normal login? // restore session connection timed out (I couldn't get over it without logging in again) diff --git a/go.mod b/go.mod index a3b47b53..e959e37e 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/BurntSushi/toml v0.0.0-20170318202913-d94612f9fc14 // indirect github.com/Jeffail/gabs v1.1.1 // indirect github.com/Philipp15b/go-steam v1.0.1-0.20180818081528-681bd9573329 + github.com/Rhymen/go-whatsapp v0.0.2-0.20190325075644-cc2581bbf24d github.com/bwmarrin/discordgo v0.19.0 github.com/d5/tengo v1.20.0 github.com/dfordsoft/golib v0.0.0-20180902042739-76ee6ab99bec @@ -27,12 +28,10 @@ require ( github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5 // indirect github.com/lusis/slack-test v0.0.0-20180109053238-3c758769bfa6 // indirect github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d - github.com/matterbridge/go-whatsapp v0.0.1-0.20190301204034-f2f1b29d441b github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91 github.com/matterbridge/gomatrix v0.0.0-20190102230110-6f9631ca6dea github.com/matterbridge/gozulipbot v0.0.0-20190212232658-7aa251978a18 github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61 - github.com/matterbridge/mautrix-whatsapp v0.0.0-20190301210046-3539cf52ed6e github.com/mattermost/mattermost-server v5.5.0+incompatible github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/mreiferson/go-httpclient v0.0.0-20160630210159-31f0106b4474 // indirect @@ -45,7 +44,6 @@ require ( github.com/paulrosania/go-charset v0.0.0-20151028000031-621bb39fcc83 github.com/pborman/uuid v0.0.0-20160216163710-c55201b03606 // indirect github.com/peterhellberg/emojilib v0.0.0-20190124112554-c18758d55320 - github.com/pkg/errors v0.8.0 // indirect github.com/rs/xid v1.2.1 github.com/russross/blackfriday v1.5.2 github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca @@ -68,7 +66,9 @@ require ( go.uber.org/multierr v1.1.0 // indirect go.uber.org/zap v1.9.1 // indirect golang.org/x/image v0.0.0-20190220214146-31aff87c08e9 + golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect gopkg.in/fsnotify.v1 v1.4.7 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect + maunium.net/go/mautrix-whatsapp v0.0.0-20190406194125-7e1028726f0f ) diff --git a/go.sum b/go.sum index ea77656b..bfe1986f 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,9 @@ github.com/Jeffail/gabs v1.1.1 h1:V0uzR08Hj22EX8+8QMhyI9sX2hwRu+/RJhJUmnwda/E= github.com/Jeffail/gabs v1.1.1/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc= github.com/Philipp15b/go-steam v1.0.1-0.20180818081528-681bd9573329 h1:xZBoq249G9MSt+XuY7sVQzcfONJ6IQuwpCK+KAaOpnY= github.com/Philipp15b/go-steam v1.0.1-0.20180818081528-681bd9573329/go.mod h1:HuVM+sZFzumUdKPWiz+IlCMb4RdsKdT3T+nQBKL+sYg= +github.com/Rhymen/go-whatsapp v0.0.0-20190208090600-c1173899de99/go.mod h1:rdQr95g2C1xcOfM7QGOhza58HeI3I+tZ/bbluv7VazA= +github.com/Rhymen/go-whatsapp v0.0.2-0.20190325075644-cc2581bbf24d h1:1jxx8vYOakqfKIg4oeQ6R7yZAGd6BG077d4FiNqJygE= +github.com/Rhymen/go-whatsapp v0.0.2-0.20190325075644-cc2581bbf24d/go.mod h1:XQ87CLQwmWe3c/2DFsbD6A5b5INpj06JecJbpTC3BbE= github.com/alexcesaro/log v0.0.0-20150915221235-61e686294e58/go.mod h1:YNfsMyWSs+h+PaYkxGeMVmVCX75Zj/pqdjbu12ciCYE= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/bwmarrin/discordgo v0.19.0 h1:kMED/DB0NR1QhRcalb85w0Cu3Ep2OrGAqZH1R5awQiY= @@ -31,6 +34,8 @@ github.com/go-telegram-bot-api/telegram-bot-api v4.6.5-0.20181225215658-ec221ba9 github.com/go-telegram-bot-api/telegram-bot-api v4.6.5-0.20181225215658-ec221ba9ea45+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0 h1:kbxbvI4Un1LUWKxufD+BiE6AEExYYgkQLQmLFqA1LFk= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/google/gops v0.3.5 h1:SIWvPLiYvy5vMwjxB3rVFTE4QBhUFj2KKWr3Xm7CKhw= github.com/google/gops v0.3.5/go.mod h1:pMQgrscwEK/aUSW1IFSaBPbJX82FPHWaSoJw1axQfD0= github.com/gopackage/ddp v0.0.0-20170117053602-652027933df4 h1:4EZlYQIiyecYJlUbVkFXCXHz1QPhVXcHnQKAzBTPfQo= @@ -68,6 +73,7 @@ github.com/labstack/echo/v4 v4.0.0 h1:q1GH+caIXPP7H2StPIdzy/ez9CO0EepqYeUg6vi9SW github.com/labstack/echo/v4 v4.0.0/go.mod h1:tZv7nai5buKSg5h/8E6zz4LsD/Dqh9/91Mvs7Z5Zyno= github.com/labstack/gommon v0.2.8 h1:JvRqmeZcfrHC5u6uVleB4NxxNbzx6gpbJiQknDbKQu0= github.com/labstack/gommon v0.2.8/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lrstanley/girc v0.0.0-20190210212025-51b8e096d398 h1:a40kRmhA1p2XFJ6gqXfCExSyuDDCp/U9LA8ZY27u2Lk= github.com/lrstanley/girc v0.0.0-20190210212025-51b8e096d398/go.mod h1:7cRs1SIBfKQ7e3Tam6GKTILSNHzR862JD0JpINaZoJk= github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5 h1:AsEBgzv3DhuYHI/GiQh2HxvTP71HCCE9E/tzGUzGdtU= @@ -78,8 +84,6 @@ github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDe github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d h1:F+Sr+C0ojSlYQ37BLylQtSFmyQULe3jbAygcyXQ9mVs= github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d/go.mod h1:c6MxwqHD+0HvtAJjsHMIdPCiAwGiQwPRPTp69ACMg8A= -github.com/matterbridge/go-whatsapp v0.0.1-0.20190301204034-f2f1b29d441b h1:cO6Z+yj4Ivq/ay/IxSrV90oSIW/SSXWLa+XHsiLKMrw= -github.com/matterbridge/go-whatsapp v0.0.1-0.20190301204034-f2f1b29d441b/go.mod h1:dW19fYkkdUZsBAx7zv9fDh0n6NRqYIaKwB2JEBw8d0U= github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91 h1:KzDEcy8eDbTx881giW8a6llsAck3e2bJvMyKvh1IK+k= github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91/go.mod h1:ECDRehsR9TYTKCAsRS8/wLeOk6UUqDydw47ln7wG41Q= github.com/matterbridge/gomatrix v0.0.0-20190102230110-6f9631ca6dea h1:kaADGqpK4gGO2BpzEyJrBxq2Jc57Rsar4i2EUxcACUc= @@ -88,8 +92,6 @@ github.com/matterbridge/gozulipbot v0.0.0-20190212232658-7aa251978a18 h1:fLhwXtW github.com/matterbridge/gozulipbot v0.0.0-20190212232658-7aa251978a18/go.mod h1:yAjnZ34DuDyPHMPHHjOsTk/FefW4JJjoMMCGt/8uuQA= github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61 h1:R/MgM/eUyRBQx2FiH6JVmXck8PaAuKfe2M1tWIzW7nE= github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61/go.mod h1:iXGEotOvwI1R1SjLxRc+BF5rUORTMtE0iMZBT2lxqAU= -github.com/matterbridge/mautrix-whatsapp v0.0.0-20190301210046-3539cf52ed6e h1:1NqciL8sz+0UYeFrd/UQlL8tJPhFxOBmg+a94DN2sJU= -github.com/matterbridge/mautrix-whatsapp v0.0.0-20190301210046-3539cf52ed6e/go.mod h1:DrIFGcFumRlEW5k3PJjWGKPd4+w37d3SwOxlh1ZAL+4= github.com/mattermost/mattermost-server v5.5.0+incompatible h1:0wcLGgYtd+YImtLDPf2AOfpBHxbU4suATx+6XKw1XbU= github.com/mattermost/mattermost-server v5.5.0+incompatible/go.mod h1:5L6MjAec+XXQwMIt791Ganu45GKsSiM+I0tLR9wUj8Y= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -125,8 +127,8 @@ github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181 github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterhellberg/emojilib v0.0.0-20190124112554-c18758d55320 h1:YxcQy/DV+48NGv1lxx1vsWBzs6W1f1ogubkuCozxpX0= github.com/peterhellberg/emojilib v0.0.0-20190124112554-c18758d55320/go.mod h1:G7LufuPajuIvdt9OitkNt2qh0mmvD4bfRgRM7bhDIOA= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc= @@ -201,20 +203,26 @@ golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f h1:qWFY9ZxP3tfI37wYIs/MnIAqK0vlXp1xnYEa5HxFSSY= golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/image v0.0.0-20190220214146-31aff87c08e9 h1:+vH8qNweCrORN49012OX3h0oWEXO3p+rRnpAGQinddk= golang.org/x/image v0.0.0-20190220214146-31aff87c08e9/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190110200230-915654e7eabc h1:Yx9JGxI1SBhVLFjpAkWMaO1TF+xyqtHLjZpvQboJGiM= golang.org/x/net v0.0.0-20190110200230-915654e7eabc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222171317-cd391775e71e h1:oF7qaQxUH6KzFdKN4ww7NpPdo53SZi4UlcksLrb2y/o= golang.org/x/sys v0.0.0-20190222171317-cd391775e71e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -230,3 +238,5 @@ maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfk maunium.net/go/maulogger/v2 v2.0.0/go.mod h1:Hbbkq3NV6jvJodByZu1mgEF3fpT7Kz9z0MjEZ3/BusI= maunium.net/go/mautrix v0.1.0-alpha.3/go.mod h1:GTVu6WDHR+98DKOrYetWsXorvUeKQV3jsSWO6ScbuFI= maunium.net/go/mautrix-appservice v0.1.0-alpha.3/go.mod h1:wOnWOIuprYad7ly12rHIo3JLCPh4jwvx1prVrAB9RhM= +maunium.net/go/mautrix-whatsapp v0.0.0-20190406194125-7e1028726f0f h1:J6eQrwVdnhiAyX56YaKyalRDGxMlXX21+Gqd00eGsro= +maunium.net/go/mautrix-whatsapp v0.0.0-20190406194125-7e1028726f0f/go.mod h1:iqJEzlNB8kmssHfS4rmV77Pv+toWkchfUI+NCyauOIA= diff --git a/vendor/github.com/Rhymen/go-whatsapp/.gitignore b/vendor/github.com/Rhymen/go-whatsapp/.gitignore new file mode 100644 index 00000000..b553f0fd --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/.gitignore @@ -0,0 +1,3 @@ +.idea/ +docs/ +build/ diff --git a/vendor/github.com/Rhymen/go-whatsapp/LICENSE b/vendor/github.com/Rhymen/go-whatsapp/LICENSE new file mode 100644 index 00000000..b442934b --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/Rhymen/go-whatsapp/README.md b/vendor/github.com/Rhymen/go-whatsapp/README.md new file mode 100644 index 00000000..54024de8 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/README.md @@ -0,0 +1,104 @@ +# go-whatsapp +Package rhymen/go-whatsapp implements the WhatsApp Web API to provide a clean interface for developers. Big thanks to all contributors of the [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng) project. The official WhatsApp Business API was released in August 2018. You can check it out [here](https://www.whatsapp.com/business/api). + +## Installation +```sh +go get github.com/Rhymen/go-whatsapp +``` + +## Usage +### Creating a connection +```go +import ( + whatsapp "github.com/Rhymen/go-whatsapp" +) + +wac, err := whatsapp.NewConn(20 * time.Second) +``` +The duration passed to the NewConn function is used to timeout login requests. If you have a bad internet connection use a higher timeout value. This function only creates a websocket connection, it does not handle authentication. + +### Login +```go +qrChan := make(chan string) +go func() { + fmt.Printf("qr code: %v\n", <-qrChan) + //show qr code or save it somewhere to scan +} +sess, err := wac.Login(qrChan) +``` +The authentication process requires you to scan the qr code, that is send through the channel, with the device you are using whatsapp on. The session struct that is returned can be saved and used to restore the login without scanning the qr code again. The qr code has a ttl of 20 seconds and the login function throws a timeout err if the time has passed or any other request fails. + +### Restore +```go +newSess, err := wac.RestoreSession(sess) +``` +The restore function needs a valid session and returns the new session that was created. + +### Add message handlers +```go +type myHandler struct{} + +func (myHandler) HandleError(err error) { + fmt.Fprintf(os.Stderr, "%v", err) +} + +func (myHandler) HandleTextMessage(message whatsapp.TextMessage) { + fmt.Println(message) +} + +func (myHandler) HandleImageMessage(message whatsapp.ImageMessage) { + fmt.Println(message) +} + +func (myHandler) HandleVideoMessage(message whatsapp.VideoMessage) { + fmt.Println(message) +} + +func (myHandler) HandleJsonMessage(message string) { + fmt.Println(message) +} + +wac.AddHandler(myHandler{}) +``` +The message handlers are all optional, you don't need to implement anything but the error handler to implement the interface. The ImageMessage and VideoMessage provide a Download function to get the media data. + +### Sending text messages +```go +text := whatsapp.TextMessage{ + Info: whatsapp.MessageInfo{ + RemoteJid: "0123456789@s.whatsapp.net", + }, + Text: "Hello Whatsapp", +} + +err := wac.Send(text) +``` +The message will be send over the websocket. The attributes seen above are the required ones. All other relevant attributes (id, timestamp, fromMe, status) are set if they are missing in the struct. For the time being we only support text messages, but other types are planned for the near future. + +## Legal +This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by WhatsApp or any of its +affiliates or subsidiaries. This is an independent and unofficial software. Use at your own risk. + +## License + +The MIT License (MIT) + +Copyright (c) 2018 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/github.com/Rhymen/go-whatsapp/binary/decoder.go b/vendor/github.com/Rhymen/go-whatsapp/binary/decoder.go new file mode 100644 index 00000000..95da606c --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/binary/decoder.go @@ -0,0 +1,388 @@ +package binary + +import ( + "fmt" + "github.com/Rhymen/go-whatsapp/binary/token" + "io" + "strconv" +) + +type binaryDecoder struct { + data []byte + index int +} + +func NewDecoder(data []byte) *binaryDecoder { + return &binaryDecoder{data, 0} +} + +func (r *binaryDecoder) checkEOS(length int) error { + if r.index+length > len(r.data) { + return io.EOF + } + + return nil +} + +func (r *binaryDecoder) readByte() (byte, error) { + if err := r.checkEOS(1); err != nil { + return 0, err + } + + b := r.data[r.index] + r.index++ + + return b, nil +} + +func (r *binaryDecoder) readIntN(n int, littleEndian bool) (int, error) { + if err := r.checkEOS(n); err != nil { + return 0, err + } + + var ret int + + for i := 0; i < n; i++ { + var curShift int + if littleEndian { + curShift = i + } else { + curShift = n - i - 1 + } + ret |= int(r.data[r.index+i]) << uint(curShift*8) + } + + r.index += n + return ret, nil +} + +func (r *binaryDecoder) readInt8(littleEndian bool) (int, error) { + return r.readIntN(1, littleEndian) +} + +func (r *binaryDecoder) readInt16(littleEndian bool) (int, error) { + return r.readIntN(2, littleEndian) +} + +func (r *binaryDecoder) readInt20() (int, error) { + if err := r.checkEOS(3); err != nil { + return 0, err + } + + ret := ((int(r.data[r.index]) & 15) << 16) + (int(r.data[r.index+1]) << 8) + int(r.data[r.index+2]) + r.index += 3 + return ret, nil +} + +func (r *binaryDecoder) readInt32(littleEndian bool) (int, error) { + return r.readIntN(4, littleEndian) +} + +func (r *binaryDecoder) readInt64(littleEndian bool) (int, error) { + return r.readIntN(8, littleEndian) +} + +func (r *binaryDecoder) readPacked8(tag int) (string, error) { + startByte, err := r.readByte() + if err != nil { + return "", err + } + + ret := "" + + for i := 0; i < int(startByte&127); i++ { + currByte, err := r.readByte() + if err != nil { + return "", err + } + + lower, err := unpackByte(tag, currByte&0xF0>>4) + if err != nil { + return "", err + } + + upper, err := unpackByte(tag, currByte&0x0F) + if err != nil { + return "", err + } + + ret += lower + upper + } + + if startByte>>7 != 0 { + ret = ret[:len(ret)-1] + } + return ret, nil +} + +func unpackByte(tag int, value byte) (string, error) { + switch tag { + case token.NIBBLE_8: + return unpackNibble(value) + case token.HEX_8: + return unpackHex(value) + default: + return "", fmt.Errorf("unpackByte with unknown tag %d", tag) + } +} + +func unpackNibble(value byte) (string, error) { + switch { + case value < 0 || value > 15: + return "", fmt.Errorf("unpackNibble with value %d", value) + case value == 10: + return "-", nil + case value == 11: + return ".", nil + case value == 15: + return "\x00", nil + default: + return strconv.Itoa(int(value)), nil + } +} + +func unpackHex(value byte) (string, error) { + switch { + case value < 0 || value > 15: + return "", fmt.Errorf("unpackHex with value %d", value) + case value < 10: + return strconv.Itoa(int(value)), nil + default: + return string('A' + value - 10), nil + } +} + +func (r *binaryDecoder) readListSize(tag int) (int, error) { + switch tag { + case token.LIST_EMPTY: + return 0, nil + case token.LIST_8: + return r.readInt8(false) + case token.LIST_16: + return r.readInt16(false) + default: + return 0, fmt.Errorf("readListSize with unknown tag %d at position %d", tag, r.index) + } +} + +func (r *binaryDecoder) readString(tag int) (string, error) { + switch { + case tag >= 3 && tag <= len(token.SingleByteTokens): + tok, err := token.GetSingleToken(tag) + if err != nil { + return "", err + } + + if tok == "s.whatsapp.net" { + tok = "c.us" + } + + return tok, nil + case tag == token.DICTIONARY_0 || tag == token.DICTIONARY_1 || tag == token.DICTIONARY_2 || tag == token.DICTIONARY_3: + i, err := r.readInt8(false) + if err != nil { + return "", err + } + + return token.GetDoubleToken(tag-token.DICTIONARY_0, i) + case tag == token.LIST_EMPTY: + return "", nil + case tag == token.BINARY_8: + length, err := r.readInt8(false) + if err != nil { + return "", err + } + + return r.readStringFromChars(length) + case tag == token.BINARY_20: + length, err := r.readInt20() + if err != nil { + return "", err + } + + return r.readStringFromChars(length) + case tag == token.BINARY_32: + length, err := r.readInt32(false) + if err != nil { + return "", err + } + + return r.readStringFromChars(length) + case tag == token.JID_PAIR: + b, err := r.readByte() + if err != nil { + return "", err + } + i, err := r.readString(int(b)) + if err != nil { + return "", err + } + + b, err = r.readByte() + if err != nil { + return "", err + } + j, err := r.readString(int(b)) + if err != nil { + return "", err + } + + if i == "" || j == "" { + return "", fmt.Errorf("invalid jid pair: %s - %s", i, j) + } + + return i + "@" + j, nil + case tag == token.NIBBLE_8 || tag == token.HEX_8: + return r.readPacked8(tag) + default: + return "", fmt.Errorf("invalid string with tag %d", tag) + } +} + +func (r *binaryDecoder) readStringFromChars(length int) (string, error) { + if err := r.checkEOS(length); err != nil { + return "", err + } + + ret := r.data[r.index : r.index+length] + r.index += length + + return string(ret), nil +} + +func (r *binaryDecoder) readAttributes(n int) (map[string]string, error) { + if n == 0 { + return nil, nil + } + + ret := make(map[string]string) + for i := 0; i < n; i++ { + idx, err := r.readInt8(false) + if err != nil { + return nil, err + } + + index, err := r.readString(idx) + if err != nil { + return nil, err + } + + idx, err = r.readInt8(false) + if err != nil { + return nil, err + } + + ret[index], err = r.readString(idx) + if err != nil { + return nil, err + } + } + + return ret, nil +} + +func (r *binaryDecoder) readList(tag int) ([]Node, error) { + size, err := r.readListSize(tag) + if err != nil { + return nil, err + } + + ret := make([]Node, size) + for i := 0; i < size; i++ { + n, err := r.ReadNode() + + if err != nil { + return nil, err + } + + ret[i] = *n + } + + return ret, nil +} + +func (r *binaryDecoder) ReadNode() (*Node, error) { + ret := &Node{} + + size, err := r.readInt8(false) + if err != nil { + return nil, err + } + listSize, err := r.readListSize(size) + if err != nil { + return nil, err + } + + descrTag, err := r.readInt8(false) + if descrTag == token.STREAM_END { + return nil, fmt.Errorf("unexpected stream end") + } + ret.Description, err = r.readString(descrTag) + if err != nil { + return nil, err + } + if listSize == 0 || ret.Description == "" { + return nil, fmt.Errorf("invalid Node") + } + + ret.Attributes, err = r.readAttributes((listSize - 1) >> 1) + if err != nil { + return nil, err + } + + if listSize%2 == 1 { + return ret, nil + } + + tag, err := r.readInt8(false) + if err != nil { + return nil, err + } + + switch tag { + case token.LIST_EMPTY, token.LIST_8, token.LIST_16: + ret.Content, err = r.readList(tag) + case token.BINARY_8: + size, err = r.readInt8(false) + if err != nil { + return nil, err + } + + ret.Content, err = r.readBytes(size) + case token.BINARY_20: + size, err = r.readInt20() + if err != nil { + return nil, err + } + + ret.Content, err = r.readBytes(size) + case token.BINARY_32: + size, err = r.readInt32(false) + if err != nil { + return nil, err + } + + ret.Content, err = r.readBytes(size) + default: + ret.Content, err = r.readString(tag) + } + + if err != nil { + return nil, err + } + return ret, nil +} + +func (r *binaryDecoder) readBytes(n int) ([]byte, error) { + ret := make([]byte, n) + var err error + + for i := range ret { + ret[i], err = r.readByte() + if err != nil { + return nil, err + } + } + + return ret, nil +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/binary/encoder.go b/vendor/github.com/Rhymen/go-whatsapp/binary/encoder.go new file mode 100644 index 00000000..59003e7a --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/binary/encoder.go @@ -0,0 +1,351 @@ +package binary + +import ( + "fmt" + "github.com/Rhymen/go-whatsapp/binary/token" + "math" + "strconv" + "strings" +) + +type binaryEncoder struct { + data []byte +} + +func NewEncoder() *binaryEncoder { + return &binaryEncoder{make([]byte, 0)} +} + +func (w *binaryEncoder) GetData() []byte { + return w.data +} + +func (w *binaryEncoder) pushByte(b byte) { + w.data = append(w.data, b) +} + +func (w *binaryEncoder) pushBytes(bytes []byte) { + w.data = append(w.data, bytes...) +} + +func (w *binaryEncoder) pushIntN(value, n int, littleEndian bool) { + for i := 0; i < n; i++ { + var curShift int + if littleEndian { + curShift = i + } else { + curShift = n - i - 1 + } + w.pushByte(byte((value >> uint(curShift*8)) & 0xFF)) + } +} + +func (w *binaryEncoder) pushInt20(value int) { + w.pushBytes([]byte{byte((value >> 16) & 0x0F), byte((value >> 8) & 0xFF), byte(value & 0xFF)}) +} + +func (w *binaryEncoder) pushInt8(value int) { + w.pushIntN(value, 1, false) +} + +func (w *binaryEncoder) pushInt16(value int) { + w.pushIntN(value, 2, false) +} + +func (w *binaryEncoder) pushInt32(value int) { + w.pushIntN(value, 4, false) +} + +func (w *binaryEncoder) pushInt64(value int) { + w.pushIntN(value, 8, false) +} + +func (w *binaryEncoder) pushString(value string) { + w.pushBytes([]byte(value)) +} + +func (w *binaryEncoder) writeByteLength(length int) error { + if length > math.MaxInt32 { + return fmt.Errorf("length is too large: %d", length) + } else if length >= (1 << 20) { + w.pushByte(token.BINARY_32) + w.pushInt32(length) + } else if length >= 256 { + w.pushByte(token.BINARY_20) + w.pushInt20(length) + } else { + w.pushByte(token.BINARY_8) + w.pushInt8(length) + } + + return nil +} + +func (w *binaryEncoder) WriteNode(n Node) error { + numAttributes := 0 + if n.Attributes != nil { + numAttributes = len(n.Attributes) + } + + hasContent := 0 + if n.Content != nil { + hasContent = 1 + } + + w.writeListStart(2*numAttributes + 1 + hasContent) + if err := w.writeString(n.Description, false); err != nil { + return err + } + + if err := w.writeAttributes(n.Attributes); err != nil { + return err + } + + if err := w.writeChildren(n.Content); err != nil { + return err + } + + return nil +} + +func (w *binaryEncoder) writeString(tok string, i bool) error { + if !i && tok == "c.us" { + if err := w.writeToken(token.IndexOfSingleToken("s.whatsapp.net")); err != nil { + return err + } + return nil + } + + tokenIndex := token.IndexOfSingleToken(tok) + if tokenIndex == -1 { + jidSepIndex := strings.Index(tok, "@") + if jidSepIndex < 1 { + w.writeStringRaw(tok) + } else { + w.writeJid(tok[:jidSepIndex], tok[jidSepIndex+1:]) + } + } else { + if tokenIndex < token.SINGLE_BYTE_MAX { + if err := w.writeToken(tokenIndex); err != nil { + return err + } + } else { + singleByteOverflow := tokenIndex - token.SINGLE_BYTE_MAX + dictionaryIndex := singleByteOverflow >> 8 + if dictionaryIndex < 0 || dictionaryIndex > 3 { + return fmt.Errorf("double byte dictionary token out of range: %v", tok) + } + if err := w.writeToken(token.DICTIONARY_0 + dictionaryIndex); err != nil { + return err + } + if err := w.writeToken(singleByteOverflow % 256); err != nil { + return err + } + } + } + + return nil +} + +func (w *binaryEncoder) writeStringRaw(value string) error { + if err := w.writeByteLength(len(value)); err != nil { + return err + } + + w.pushString(value) + + return nil +} + +func (w *binaryEncoder) writeJid(jidLeft, jidRight string) error { + w.pushByte(token.JID_PAIR) + + if jidLeft != "" { + if err := w.writePackedBytes(jidLeft); err != nil { + return err + } + } else { + if err := w.writeToken(token.LIST_EMPTY); err != nil { + return err + } + } + + if err := w.writeString(jidRight, false); err != nil { + return err + } + + return nil +} + +func (w *binaryEncoder) writeToken(tok int) error { + if tok < len(token.SingleByteTokens) { + w.pushByte(byte(tok)) + } else if tok <= 500 { + return fmt.Errorf("invalid token: %d", tok) + } + + return nil +} + +func (w *binaryEncoder) writeAttributes(attributes map[string]string) error { + if attributes == nil { + return nil + } + + for key, val := range attributes { + if val == "" { + continue + } + + if err := w.writeString(key, false); err != nil { + return err + } + + if err := w.writeString(val, false); err != nil { + return err + } + } + + return nil +} + +func (w *binaryEncoder) writeChildren(children interface{}) error { + if children == nil { + return nil + } + + switch childs := children.(type) { + case string: + if err := w.writeString(childs, true); err != nil { + return err + } + case []byte: + if err := w.writeByteLength(len(childs)); err != nil { + return err + } + + w.pushBytes(childs) + case []Node: + w.writeListStart(len(childs)) + for _, n := range childs { + if err := w.WriteNode(n); err != nil { + return err + } + } + default: + return fmt.Errorf("cannot write child of type: %T", children) + } + + return nil +} + +func (w *binaryEncoder) writeListStart(listSize int) { + if listSize == 0 { + w.pushByte(byte(token.LIST_EMPTY)) + } else if listSize < 256 { + w.pushByte(byte(token.LIST_8)) + w.pushInt8(listSize) + } else { + w.pushByte(byte(token.LIST_16)) + w.pushInt16(listSize) + } +} + +func (w *binaryEncoder) writePackedBytes(value string) error { + if err := w.writePackedBytesImpl(value, token.NIBBLE_8); err != nil { + if err := w.writePackedBytesImpl(value, token.HEX_8); err != nil { + return err + } + } + + return nil +} + +func (w *binaryEncoder) writePackedBytesImpl(value string, dataType int) error { + numBytes := len(value) + if numBytes > token.PACKED_MAX { + return fmt.Errorf("too many bytes to pack: %d", numBytes) + } + + w.pushByte(byte(dataType)) + + x := 0 + if numBytes%2 != 0 { + x = 128 + } + w.pushByte(byte(x | int(math.Ceil(float64(numBytes)/2.0)))) + for i, l := 0, numBytes/2; i < l; i++ { + b, err := w.packBytePair(dataType, value[2*i:2*i+1], value[2*i+1:2*i+2]) + if err != nil { + return err + } + + w.pushByte(byte(b)) + } + + if (numBytes % 2) != 0 { + b, err := w.packBytePair(dataType, value[numBytes-1:], "\x00") + if err != nil { + return err + } + + w.pushByte(byte(b)) + } + + return nil +} + +func (w *binaryEncoder) packBytePair(packType int, part1, part2 string) (int, error) { + if packType == token.NIBBLE_8 { + n1, err := packNibble(part1) + if err != nil { + return 0, err + } + + n2, err := packNibble(part2) + if err != nil { + return 0, err + } + + return (n1 << 4) | n2, nil + } else if packType == token.HEX_8 { + n1, err := packHex(part1) + if err != nil { + return 0, err + } + + n2, err := packHex(part2) + if err != nil { + return 0, err + } + + return (n1 << 4) | n2, nil + } else { + return 0, fmt.Errorf("invalid pack type (%d) for byte pair: %s / %s", packType, part1, part2) + } +} + +func packNibble(value string) (int, error) { + if value >= "0" && value <= "9" { + return strconv.Atoi(value) + } else if value == "-" { + return 10, nil + } else if value == "." { + return 11, nil + } else if value == "\x00" { + return 15, nil + } + + return 0, fmt.Errorf("invalid string to pack as nibble: %v", value) +} + +func packHex(value string) (int, error) { + if (value >= "0" && value <= "9") || (value >= "A" && value <= "F") || (value >= "a" && value <= "f") { + d, err := strconv.ParseInt(value, 16, 0) + return int(d), err + } else if value == "\x00" { + return 15, nil + } + + return 0, fmt.Errorf("invalid string to pack as hex: %v", value) +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/binary/node.go b/vendor/github.com/Rhymen/go-whatsapp/binary/node.go new file mode 100644 index 00000000..2139e385 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/binary/node.go @@ -0,0 +1,103 @@ +package binary + +import ( + "fmt" + pb "github.com/Rhymen/go-whatsapp/binary/proto" + "github.com/golang/protobuf/proto" +) + +type Node struct { + Description string + Attributes map[string]string + Content interface{} +} + +func Marshal(n Node) ([]byte, error) { + if n.Attributes != nil && n.Content != nil { + a, err := marshalMessageArray(n.Content.([]interface{})) + if err != nil { + return nil, err + } + n.Content = a + } + + w := NewEncoder() + if err := w.WriteNode(n); err != nil { + return nil, err + } + + return w.GetData(), nil +} + +func marshalMessageArray(messages []interface{}) ([]Node, error) { + ret := make([]Node, len(messages)) + + for i, m := range messages { + if wmi, ok := m.(*pb.WebMessageInfo); ok { + b, err := marshalWebMessageInfo(wmi) + if err != nil { + return nil, nil + } + ret[i] = Node{"message", nil, b} + } else { + ret[i], ok = m.(Node) + if !ok { + return nil, fmt.Errorf("invalid Node") + } + } + } + + return ret, nil +} + +func marshalWebMessageInfo(p *pb.WebMessageInfo) ([]byte, error) { + b, err := proto.Marshal(p) + if err != nil { + return nil, err + } + return b, nil +} + +func Unmarshal(data []byte) (*Node, error) { + r := NewDecoder(data) + n, err := r.ReadNode() + if err != nil { + return nil, err + } + + if n != nil && n.Attributes != nil && n.Content != nil { + n.Content, err = unmarshalMessageArray(n.Content.([]Node)) + if err != nil { + return nil, err + } + } + + return n, nil +} + +func unmarshalMessageArray(messages []Node) ([]interface{}, error) { + ret := make([]interface{}, len(messages)) + + for i, msg := range messages { + if msg.Description == "message" { + info, err := unmarshalWebMessageInfo(msg.Content.([]byte)) + if err != nil { + return nil, err + } + ret[i] = info + } else { + ret[i] = msg + } + } + + return ret, nil +} + +func unmarshalWebMessageInfo(msg []byte) (*pb.WebMessageInfo, error) { + message := &pb.WebMessageInfo{} + err := proto.Unmarshal(msg, message) + if err != nil { + return nil, err + } + return message, nil +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/binary/proto/def.pb.go b/vendor/github.com/Rhymen/go-whatsapp/binary/proto/def.pb.go new file mode 100644 index 00000000..71d9923f --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/binary/proto/def.pb.go @@ -0,0 +1,3800 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: def.proto + +package proto + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type ExtendedTextMessage_FONTTYPE int32 + +const ( + ExtendedTextMessage_SANS_SERIF ExtendedTextMessage_FONTTYPE = 0 + ExtendedTextMessage_SERIF ExtendedTextMessage_FONTTYPE = 1 + ExtendedTextMessage_NORICAN_REGULAR ExtendedTextMessage_FONTTYPE = 2 + ExtendedTextMessage_BRYNDAN_WRITE ExtendedTextMessage_FONTTYPE = 3 + ExtendedTextMessage_BEBASNEUE_REGULAR ExtendedTextMessage_FONTTYPE = 4 + ExtendedTextMessage_OSWALD_HEAVY ExtendedTextMessage_FONTTYPE = 5 +) + +var ExtendedTextMessage_FONTTYPE_name = map[int32]string{ + 0: "SANS_SERIF", + 1: "SERIF", + 2: "NORICAN_REGULAR", + 3: "BRYNDAN_WRITE", + 4: "BEBASNEUE_REGULAR", + 5: "OSWALD_HEAVY", +} +var ExtendedTextMessage_FONTTYPE_value = map[string]int32{ + "SANS_SERIF": 0, + "SERIF": 1, + "NORICAN_REGULAR": 2, + "BRYNDAN_WRITE": 3, + "BEBASNEUE_REGULAR": 4, + "OSWALD_HEAVY": 5, +} + +func (x ExtendedTextMessage_FONTTYPE) Enum() *ExtendedTextMessage_FONTTYPE { + p := new(ExtendedTextMessage_FONTTYPE) + *p = x + return p +} +func (x ExtendedTextMessage_FONTTYPE) String() string { + return proto.EnumName(ExtendedTextMessage_FONTTYPE_name, int32(x)) +} +func (x *ExtendedTextMessage_FONTTYPE) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(ExtendedTextMessage_FONTTYPE_value, data, "ExtendedTextMessage_FONTTYPE") + if err != nil { + return err + } + *x = ExtendedTextMessage_FONTTYPE(value) + return nil +} +func (ExtendedTextMessage_FONTTYPE) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{7, 0} +} + +type VideoMessage_ATTRIBUTION int32 + +const ( + VideoMessage_NONE VideoMessage_ATTRIBUTION = 0 + VideoMessage_GIPHY VideoMessage_ATTRIBUTION = 1 + VideoMessage_TENOR VideoMessage_ATTRIBUTION = 2 +) + +var VideoMessage_ATTRIBUTION_name = map[int32]string{ + 0: "NONE", + 1: "GIPHY", + 2: "TENOR", +} +var VideoMessage_ATTRIBUTION_value = map[string]int32{ + "NONE": 0, + "GIPHY": 1, + "TENOR": 2, +} + +func (x VideoMessage_ATTRIBUTION) Enum() *VideoMessage_ATTRIBUTION { + p := new(VideoMessage_ATTRIBUTION) + *p = x + return p +} +func (x VideoMessage_ATTRIBUTION) String() string { + return proto.EnumName(VideoMessage_ATTRIBUTION_name, int32(x)) +} +func (x *VideoMessage_ATTRIBUTION) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(VideoMessage_ATTRIBUTION_value, data, "VideoMessage_ATTRIBUTION") + if err != nil { + return err + } + *x = VideoMessage_ATTRIBUTION(value) + return nil +} +func (VideoMessage_ATTRIBUTION) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{10, 0} +} + +type ProtocolMessage_TYPE int32 + +const ( + ProtocolMessage_REVOKE ProtocolMessage_TYPE = 0 +) + +var ProtocolMessage_TYPE_name = map[int32]string{ + 0: "REVOKE", +} +var ProtocolMessage_TYPE_value = map[string]int32{ + "REVOKE": 0, +} + +func (x ProtocolMessage_TYPE) Enum() *ProtocolMessage_TYPE { + p := new(ProtocolMessage_TYPE) + *p = x + return p +} +func (x ProtocolMessage_TYPE) String() string { + return proto.EnumName(ProtocolMessage_TYPE_name, int32(x)) +} +func (x *ProtocolMessage_TYPE) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(ProtocolMessage_TYPE_value, data, "ProtocolMessage_TYPE") + if err != nil { + return err + } + *x = ProtocolMessage_TYPE(value) + return nil +} +func (ProtocolMessage_TYPE) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{13, 0} +} + +type HSMDateTimeComponent_DAYOFWEEKTYPE int32 + +const ( + HSMDateTimeComponent_MONDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 1 + HSMDateTimeComponent_TUESDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 2 + HSMDateTimeComponent_WEDNESDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 3 + HSMDateTimeComponent_THURSDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 4 + HSMDateTimeComponent_FRIDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 5 + HSMDateTimeComponent_SATURDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 6 + HSMDateTimeComponent_SUNDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 7 +) + +var HSMDateTimeComponent_DAYOFWEEKTYPE_name = map[int32]string{ + 1: "MONDAY", + 2: "TUESDAY", + 3: "WEDNESDAY", + 4: "THURSDAY", + 5: "FRIDAY", + 6: "SATURDAY", + 7: "SUNDAY", +} +var HSMDateTimeComponent_DAYOFWEEKTYPE_value = map[string]int32{ + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7, +} + +func (x HSMDateTimeComponent_DAYOFWEEKTYPE) Enum() *HSMDateTimeComponent_DAYOFWEEKTYPE { + p := new(HSMDateTimeComponent_DAYOFWEEKTYPE) + *p = x + return p +} +func (x HSMDateTimeComponent_DAYOFWEEKTYPE) String() string { + return proto.EnumName(HSMDateTimeComponent_DAYOFWEEKTYPE_name, int32(x)) +} +func (x *HSMDateTimeComponent_DAYOFWEEKTYPE) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(HSMDateTimeComponent_DAYOFWEEKTYPE_value, data, "HSMDateTimeComponent_DAYOFWEEKTYPE") + if err != nil { + return err + } + *x = HSMDateTimeComponent_DAYOFWEEKTYPE(value) + return nil +} +func (HSMDateTimeComponent_DAYOFWEEKTYPE) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{16, 0} +} + +type HSMDateTimeComponent_CALENDARTYPE int32 + +const ( + HSMDateTimeComponent_GREGORIAN HSMDateTimeComponent_CALENDARTYPE = 1 + HSMDateTimeComponent_SOLAR_HIJRI HSMDateTimeComponent_CALENDARTYPE = 2 +) + +var HSMDateTimeComponent_CALENDARTYPE_name = map[int32]string{ + 1: "GREGORIAN", + 2: "SOLAR_HIJRI", +} +var HSMDateTimeComponent_CALENDARTYPE_value = map[string]int32{ + "GREGORIAN": 1, + "SOLAR_HIJRI": 2, +} + +func (x HSMDateTimeComponent_CALENDARTYPE) Enum() *HSMDateTimeComponent_CALENDARTYPE { + p := new(HSMDateTimeComponent_CALENDARTYPE) + *p = x + return p +} +func (x HSMDateTimeComponent_CALENDARTYPE) String() string { + return proto.EnumName(HSMDateTimeComponent_CALENDARTYPE_name, int32(x)) +} +func (x *HSMDateTimeComponent_CALENDARTYPE) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(HSMDateTimeComponent_CALENDARTYPE_value, data, "HSMDateTimeComponent_CALENDARTYPE") + if err != nil { + return err + } + *x = HSMDateTimeComponent_CALENDARTYPE(value) + return nil +} +func (HSMDateTimeComponent_CALENDARTYPE) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{16, 1} +} + +type WebMessageInfo_STATUS int32 + +const ( + WebMessageInfo_ERROR WebMessageInfo_STATUS = 0 + WebMessageInfo_PENDING WebMessageInfo_STATUS = 1 + WebMessageInfo_SERVER_ACK WebMessageInfo_STATUS = 2 + WebMessageInfo_DELIVERY_ACK WebMessageInfo_STATUS = 3 + WebMessageInfo_READ WebMessageInfo_STATUS = 4 + WebMessageInfo_PLAYED WebMessageInfo_STATUS = 5 +) + +var WebMessageInfo_STATUS_name = map[int32]string{ + 0: "ERROR", + 1: "PENDING", + 2: "SERVER_ACK", + 3: "DELIVERY_ACK", + 4: "READ", + 5: "PLAYED", +} +var WebMessageInfo_STATUS_value = map[string]int32{ + "ERROR": 0, + "PENDING": 1, + "SERVER_ACK": 2, + "DELIVERY_ACK": 3, + "READ": 4, + "PLAYED": 5, +} + +func (x WebMessageInfo_STATUS) Enum() *WebMessageInfo_STATUS { + p := new(WebMessageInfo_STATUS) + *p = x + return p +} +func (x WebMessageInfo_STATUS) String() string { + return proto.EnumName(WebMessageInfo_STATUS_name, int32(x)) +} +func (x *WebMessageInfo_STATUS) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(WebMessageInfo_STATUS_value, data, "WebMessageInfo_STATUS") + if err != nil { + return err + } + *x = WebMessageInfo_STATUS(value) + return nil +} +func (WebMessageInfo_STATUS) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{30, 0} +} + +type WebMessageInfo_STUBTYPE int32 + +const ( + WebMessageInfo_UNKNOWN WebMessageInfo_STUBTYPE = 0 + WebMessageInfo_REVOKE WebMessageInfo_STUBTYPE = 1 + WebMessageInfo_CIPHERTEXT WebMessageInfo_STUBTYPE = 2 + WebMessageInfo_FUTUREPROOF WebMessageInfo_STUBTYPE = 3 + WebMessageInfo_NON_VERIFIED_TRANSITION WebMessageInfo_STUBTYPE = 4 + WebMessageInfo_UNVERIFIED_TRANSITION WebMessageInfo_STUBTYPE = 5 + WebMessageInfo_VERIFIED_TRANSITION WebMessageInfo_STUBTYPE = 6 + WebMessageInfo_VERIFIED_LOW_UNKNOWN WebMessageInfo_STUBTYPE = 7 + WebMessageInfo_VERIFIED_HIGH WebMessageInfo_STUBTYPE = 8 + WebMessageInfo_VERIFIED_INITIAL_UNKNOWN WebMessageInfo_STUBTYPE = 9 + WebMessageInfo_VERIFIED_INITIAL_LOW WebMessageInfo_STUBTYPE = 10 + WebMessageInfo_VERIFIED_INITIAL_HIGH WebMessageInfo_STUBTYPE = 11 + WebMessageInfo_VERIFIED_TRANSITION_ANY_TO_NONE WebMessageInfo_STUBTYPE = 12 + WebMessageInfo_VERIFIED_TRANSITION_ANY_TO_HIGH WebMessageInfo_STUBTYPE = 13 + WebMessageInfo_VERIFIED_TRANSITION_HIGH_TO_LOW WebMessageInfo_STUBTYPE = 14 + WebMessageInfo_VERIFIED_TRANSITION_HIGH_TO_UNKNOWN WebMessageInfo_STUBTYPE = 15 + WebMessageInfo_VERIFIED_TRANSITION_UNKNOWN_TO_LOW WebMessageInfo_STUBTYPE = 16 + WebMessageInfo_VERIFIED_TRANSITION_LOW_TO_UNKNOWN WebMessageInfo_STUBTYPE = 17 + WebMessageInfo_VERIFIED_TRANSITION_NONE_TO_LOW WebMessageInfo_STUBTYPE = 18 + WebMessageInfo_VERIFIED_TRANSITION_NONE_TO_UNKNOWN WebMessageInfo_STUBTYPE = 19 + WebMessageInfo_GROUP_CREATE WebMessageInfo_STUBTYPE = 20 + WebMessageInfo_GROUP_CHANGE_SUBJECT WebMessageInfo_STUBTYPE = 21 + WebMessageInfo_GROUP_CHANGE_ICON WebMessageInfo_STUBTYPE = 22 + WebMessageInfo_GROUP_CHANGE_INVITE_LINK WebMessageInfo_STUBTYPE = 23 + WebMessageInfo_GROUP_CHANGE_DESCRIPTION WebMessageInfo_STUBTYPE = 24 + WebMessageInfo_GROUP_CHANGE_RESTRICT WebMessageInfo_STUBTYPE = 25 + WebMessageInfo_GROUP_CHANGE_ANNOUNCE WebMessageInfo_STUBTYPE = 26 + WebMessageInfo_GROUP_PARTICIPANT_ADD WebMessageInfo_STUBTYPE = 27 + WebMessageInfo_GROUP_PARTICIPANT_REMOVE WebMessageInfo_STUBTYPE = 28 + WebMessageInfo_GROUP_PARTICIPANT_PROMOTE WebMessageInfo_STUBTYPE = 29 + WebMessageInfo_GROUP_PARTICIPANT_DEMOTE WebMessageInfo_STUBTYPE = 30 + WebMessageInfo_GROUP_PARTICIPANT_INVITE WebMessageInfo_STUBTYPE = 31 + WebMessageInfo_GROUP_PARTICIPANT_LEAVE WebMessageInfo_STUBTYPE = 32 + WebMessageInfo_GROUP_PARTICIPANT_CHANGE_NUMBER WebMessageInfo_STUBTYPE = 33 + WebMessageInfo_BROADCAST_CREATE WebMessageInfo_STUBTYPE = 34 + WebMessageInfo_BROADCAST_ADD WebMessageInfo_STUBTYPE = 35 + WebMessageInfo_BROADCAST_REMOVE WebMessageInfo_STUBTYPE = 36 + WebMessageInfo_GENERIC_NOTIFICATION WebMessageInfo_STUBTYPE = 37 + WebMessageInfo_E2E_IDENTITY_CHANGED WebMessageInfo_STUBTYPE = 38 + WebMessageInfo_E2E_ENCRYPTED WebMessageInfo_STUBTYPE = 39 + WebMessageInfo_CALL_MISSED_VOICE WebMessageInfo_STUBTYPE = 40 + WebMessageInfo_CALL_MISSED_VIDEO WebMessageInfo_STUBTYPE = 41 + WebMessageInfo_INDIVIDUAL_CHANGE_NUMBER WebMessageInfo_STUBTYPE = 42 + WebMessageInfo_GROUP_DELETE WebMessageInfo_STUBTYPE = 43 +) + +var WebMessageInfo_STUBTYPE_name = map[int32]string{ + 0: "UNKNOWN", + 1: "REVOKE", + 2: "CIPHERTEXT", + 3: "FUTUREPROOF", + 4: "NON_VERIFIED_TRANSITION", + 5: "UNVERIFIED_TRANSITION", + 6: "VERIFIED_TRANSITION", + 7: "VERIFIED_LOW_UNKNOWN", + 8: "VERIFIED_HIGH", + 9: "VERIFIED_INITIAL_UNKNOWN", + 10: "VERIFIED_INITIAL_LOW", + 11: "VERIFIED_INITIAL_HIGH", + 12: "VERIFIED_TRANSITION_ANY_TO_NONE", + 13: "VERIFIED_TRANSITION_ANY_TO_HIGH", + 14: "VERIFIED_TRANSITION_HIGH_TO_LOW", + 15: "VERIFIED_TRANSITION_HIGH_TO_UNKNOWN", + 16: "VERIFIED_TRANSITION_UNKNOWN_TO_LOW", + 17: "VERIFIED_TRANSITION_LOW_TO_UNKNOWN", + 18: "VERIFIED_TRANSITION_NONE_TO_LOW", + 19: "VERIFIED_TRANSITION_NONE_TO_UNKNOWN", + 20: "GROUP_CREATE", + 21: "GROUP_CHANGE_SUBJECT", + 22: "GROUP_CHANGE_ICON", + 23: "GROUP_CHANGE_INVITE_LINK", + 24: "GROUP_CHANGE_DESCRIPTION", + 25: "GROUP_CHANGE_RESTRICT", + 26: "GROUP_CHANGE_ANNOUNCE", + 27: "GROUP_PARTICIPANT_ADD", + 28: "GROUP_PARTICIPANT_REMOVE", + 29: "GROUP_PARTICIPANT_PROMOTE", + 30: "GROUP_PARTICIPANT_DEMOTE", + 31: "GROUP_PARTICIPANT_INVITE", + 32: "GROUP_PARTICIPANT_LEAVE", + 33: "GROUP_PARTICIPANT_CHANGE_NUMBER", + 34: "BROADCAST_CREATE", + 35: "BROADCAST_ADD", + 36: "BROADCAST_REMOVE", + 37: "GENERIC_NOTIFICATION", + 38: "E2E_IDENTITY_CHANGED", + 39: "E2E_ENCRYPTED", + 40: "CALL_MISSED_VOICE", + 41: "CALL_MISSED_VIDEO", + 42: "INDIVIDUAL_CHANGE_NUMBER", + 43: "GROUP_DELETE", +} +var WebMessageInfo_STUBTYPE_value = map[string]int32{ + "UNKNOWN": 0, + "REVOKE": 1, + "CIPHERTEXT": 2, + "FUTUREPROOF": 3, + "NON_VERIFIED_TRANSITION": 4, + "UNVERIFIED_TRANSITION": 5, + "VERIFIED_TRANSITION": 6, + "VERIFIED_LOW_UNKNOWN": 7, + "VERIFIED_HIGH": 8, + "VERIFIED_INITIAL_UNKNOWN": 9, + "VERIFIED_INITIAL_LOW": 10, + "VERIFIED_INITIAL_HIGH": 11, + "VERIFIED_TRANSITION_ANY_TO_NONE": 12, + "VERIFIED_TRANSITION_ANY_TO_HIGH": 13, + "VERIFIED_TRANSITION_HIGH_TO_LOW": 14, + "VERIFIED_TRANSITION_HIGH_TO_UNKNOWN": 15, + "VERIFIED_TRANSITION_UNKNOWN_TO_LOW": 16, + "VERIFIED_TRANSITION_LOW_TO_UNKNOWN": 17, + "VERIFIED_TRANSITION_NONE_TO_LOW": 18, + "VERIFIED_TRANSITION_NONE_TO_UNKNOWN": 19, + "GROUP_CREATE": 20, + "GROUP_CHANGE_SUBJECT": 21, + "GROUP_CHANGE_ICON": 22, + "GROUP_CHANGE_INVITE_LINK": 23, + "GROUP_CHANGE_DESCRIPTION": 24, + "GROUP_CHANGE_RESTRICT": 25, + "GROUP_CHANGE_ANNOUNCE": 26, + "GROUP_PARTICIPANT_ADD": 27, + "GROUP_PARTICIPANT_REMOVE": 28, + "GROUP_PARTICIPANT_PROMOTE": 29, + "GROUP_PARTICIPANT_DEMOTE": 30, + "GROUP_PARTICIPANT_INVITE": 31, + "GROUP_PARTICIPANT_LEAVE": 32, + "GROUP_PARTICIPANT_CHANGE_NUMBER": 33, + "BROADCAST_CREATE": 34, + "BROADCAST_ADD": 35, + "BROADCAST_REMOVE": 36, + "GENERIC_NOTIFICATION": 37, + "E2E_IDENTITY_CHANGED": 38, + "E2E_ENCRYPTED": 39, + "CALL_MISSED_VOICE": 40, + "CALL_MISSED_VIDEO": 41, + "INDIVIDUAL_CHANGE_NUMBER": 42, + "GROUP_DELETE": 43, +} + +func (x WebMessageInfo_STUBTYPE) Enum() *WebMessageInfo_STUBTYPE { + p := new(WebMessageInfo_STUBTYPE) + *p = x + return p +} +func (x WebMessageInfo_STUBTYPE) String() string { + return proto.EnumName(WebMessageInfo_STUBTYPE_name, int32(x)) +} +func (x *WebMessageInfo_STUBTYPE) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(WebMessageInfo_STUBTYPE_value, data, "WebMessageInfo_STUBTYPE") + if err != nil { + return err + } + *x = WebMessageInfo_STUBTYPE(value) + return nil +} +func (WebMessageInfo_STUBTYPE) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{30, 1} +} + +type WebFeatures_FLAG int32 + +const ( + WebFeatures_NOT_IMPLEMENTED WebFeatures_FLAG = 0 + WebFeatures_IMPLEMENTED WebFeatures_FLAG = 1 + WebFeatures_OPTIONAL WebFeatures_FLAG = 2 +) + +var WebFeatures_FLAG_name = map[int32]string{ + 0: "NOT_IMPLEMENTED", + 1: "IMPLEMENTED", + 2: "OPTIONAL", +} +var WebFeatures_FLAG_value = map[string]int32{ + "NOT_IMPLEMENTED": 0, + "IMPLEMENTED": 1, + "OPTIONAL": 2, +} + +func (x WebFeatures_FLAG) Enum() *WebFeatures_FLAG { + p := new(WebFeatures_FLAG) + *p = x + return p +} +func (x WebFeatures_FLAG) String() string { + return proto.EnumName(WebFeatures_FLAG_name, int32(x)) +} +func (x *WebFeatures_FLAG) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(WebFeatures_FLAG_value, data, "WebFeatures_FLAG") + if err != nil { + return err + } + *x = WebFeatures_FLAG(value) + return nil +} +func (WebFeatures_FLAG) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{34, 0} +} + +type FingerprintData struct { + PublicKey *string `protobuf:"bytes,1,opt,name=publicKey" json:"publicKey,omitempty"` + Identifier *string `protobuf:"bytes,2,opt,name=identifier" json:"identifier,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FingerprintData) Reset() { *m = FingerprintData{} } +func (m *FingerprintData) String() string { return proto.CompactTextString(m) } +func (*FingerprintData) ProtoMessage() {} +func (*FingerprintData) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{0} +} +func (m *FingerprintData) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FingerprintData.Unmarshal(m, b) +} +func (m *FingerprintData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FingerprintData.Marshal(b, m, deterministic) +} +func (dst *FingerprintData) XXX_Merge(src proto.Message) { + xxx_messageInfo_FingerprintData.Merge(dst, src) +} +func (m *FingerprintData) XXX_Size() int { + return xxx_messageInfo_FingerprintData.Size(m) +} +func (m *FingerprintData) XXX_DiscardUnknown() { + xxx_messageInfo_FingerprintData.DiscardUnknown(m) +} + +var xxx_messageInfo_FingerprintData proto.InternalMessageInfo + +func (m *FingerprintData) GetPublicKey() string { + if m != nil && m.PublicKey != nil { + return *m.PublicKey + } + return "" +} + +func (m *FingerprintData) GetIdentifier() string { + if m != nil && m.Identifier != nil { + return *m.Identifier + } + return "" +} + +type CombinedFingerprint struct { + Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` + LocalFingerprint *FingerprintData `protobuf:"bytes,2,opt,name=localFingerprint" json:"localFingerprint,omitempty"` + RemoteFingerprint *FingerprintData `protobuf:"bytes,3,opt,name=remoteFingerprint" json:"remoteFingerprint,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CombinedFingerprint) Reset() { *m = CombinedFingerprint{} } +func (m *CombinedFingerprint) String() string { return proto.CompactTextString(m) } +func (*CombinedFingerprint) ProtoMessage() {} +func (*CombinedFingerprint) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{1} +} +func (m *CombinedFingerprint) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CombinedFingerprint.Unmarshal(m, b) +} +func (m *CombinedFingerprint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CombinedFingerprint.Marshal(b, m, deterministic) +} +func (dst *CombinedFingerprint) XXX_Merge(src proto.Message) { + xxx_messageInfo_CombinedFingerprint.Merge(dst, src) +} +func (m *CombinedFingerprint) XXX_Size() int { + return xxx_messageInfo_CombinedFingerprint.Size(m) +} +func (m *CombinedFingerprint) XXX_DiscardUnknown() { + xxx_messageInfo_CombinedFingerprint.DiscardUnknown(m) +} + +var xxx_messageInfo_CombinedFingerprint proto.InternalMessageInfo + +func (m *CombinedFingerprint) GetVersion() uint32 { + if m != nil && m.Version != nil { + return *m.Version + } + return 0 +} + +func (m *CombinedFingerprint) GetLocalFingerprint() *FingerprintData { + if m != nil { + return m.LocalFingerprint + } + return nil +} + +func (m *CombinedFingerprint) GetRemoteFingerprint() *FingerprintData { + if m != nil { + return m.RemoteFingerprint + } + return nil +} + +type MessageKey struct { + RemoteJid *string `protobuf:"bytes,1,opt,name=remoteJid" json:"remoteJid,omitempty"` + FromMe *bool `protobuf:"varint,2,opt,name=fromMe" json:"fromMe,omitempty"` + Id *string `protobuf:"bytes,3,opt,name=id" json:"id,omitempty"` + Participant *string `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageKey) Reset() { *m = MessageKey{} } +func (m *MessageKey) String() string { return proto.CompactTextString(m) } +func (*MessageKey) ProtoMessage() {} +func (*MessageKey) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{2} +} +func (m *MessageKey) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageKey.Unmarshal(m, b) +} +func (m *MessageKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageKey.Marshal(b, m, deterministic) +} +func (dst *MessageKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageKey.Merge(dst, src) +} +func (m *MessageKey) XXX_Size() int { + return xxx_messageInfo_MessageKey.Size(m) +} +func (m *MessageKey) XXX_DiscardUnknown() { + xxx_messageInfo_MessageKey.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageKey proto.InternalMessageInfo + +func (m *MessageKey) GetRemoteJid() string { + if m != nil && m.RemoteJid != nil { + return *m.RemoteJid + } + return "" +} + +func (m *MessageKey) GetFromMe() bool { + if m != nil && m.FromMe != nil { + return *m.FromMe + } + return false +} + +func (m *MessageKey) GetId() string { + if m != nil && m.Id != nil { + return *m.Id + } + return "" +} + +func (m *MessageKey) GetParticipant() string { + if m != nil && m.Participant != nil { + return *m.Participant + } + return "" +} + +type SenderKeyDistributionMessage struct { + GroupId *string `protobuf:"bytes,1,opt,name=groupId" json:"groupId,omitempty"` + AxolotlSenderKeyDistributionMessage []byte `protobuf:"bytes,2,opt,name=axolotlSenderKeyDistributionMessage" json:"axolotlSenderKeyDistributionMessage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SenderKeyDistributionMessage) Reset() { *m = SenderKeyDistributionMessage{} } +func (m *SenderKeyDistributionMessage) String() string { return proto.CompactTextString(m) } +func (*SenderKeyDistributionMessage) ProtoMessage() {} +func (*SenderKeyDistributionMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{3} +} +func (m *SenderKeyDistributionMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SenderKeyDistributionMessage.Unmarshal(m, b) +} +func (m *SenderKeyDistributionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SenderKeyDistributionMessage.Marshal(b, m, deterministic) +} +func (dst *SenderKeyDistributionMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_SenderKeyDistributionMessage.Merge(dst, src) +} +func (m *SenderKeyDistributionMessage) XXX_Size() int { + return xxx_messageInfo_SenderKeyDistributionMessage.Size(m) +} +func (m *SenderKeyDistributionMessage) XXX_DiscardUnknown() { + xxx_messageInfo_SenderKeyDistributionMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_SenderKeyDistributionMessage proto.InternalMessageInfo + +func (m *SenderKeyDistributionMessage) GetGroupId() string { + if m != nil && m.GroupId != nil { + return *m.GroupId + } + return "" +} + +func (m *SenderKeyDistributionMessage) GetAxolotlSenderKeyDistributionMessage() []byte { + if m != nil { + return m.AxolotlSenderKeyDistributionMessage + } + return nil +} + +type ImageMessage struct { + Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + Mimetype *string `protobuf:"bytes,2,opt,name=mimetype" json:"mimetype,omitempty"` + Caption *string `protobuf:"bytes,3,opt,name=caption" json:"caption,omitempty"` + FileSha256 []byte `protobuf:"bytes,4,opt,name=fileSha256" json:"fileSha256,omitempty"` + FileLength *uint64 `protobuf:"varint,5,opt,name=fileLength" json:"fileLength,omitempty"` + Height *uint32 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` + Width *uint32 `protobuf:"varint,7,opt,name=width" json:"width,omitempty"` + MediaKey []byte `protobuf:"bytes,8,opt,name=mediaKey" json:"mediaKey,omitempty"` + FileEncSha256 []byte `protobuf:"bytes,9,opt,name=fileEncSha256" json:"fileEncSha256,omitempty"` + InteractiveAnnotations []*InteractiveAnnotation `protobuf:"bytes,10,rep,name=interactiveAnnotations" json:"interactiveAnnotations,omitempty"` + DirectPath *string `protobuf:"bytes,11,opt,name=directPath" json:"directPath,omitempty"` + JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` + ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` + FirstScanSidecar []byte `protobuf:"bytes,18,opt,name=firstScanSidecar" json:"firstScanSidecar,omitempty"` + FirstScanLength *uint32 `protobuf:"varint,19,opt,name=firstScanLength" json:"firstScanLength,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ImageMessage) Reset() { *m = ImageMessage{} } +func (m *ImageMessage) String() string { return proto.CompactTextString(m) } +func (*ImageMessage) ProtoMessage() {} +func (*ImageMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{4} +} +func (m *ImageMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ImageMessage.Unmarshal(m, b) +} +func (m *ImageMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ImageMessage.Marshal(b, m, deterministic) +} +func (dst *ImageMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImageMessage.Merge(dst, src) +} +func (m *ImageMessage) XXX_Size() int { + return xxx_messageInfo_ImageMessage.Size(m) +} +func (m *ImageMessage) XXX_DiscardUnknown() { + xxx_messageInfo_ImageMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_ImageMessage proto.InternalMessageInfo + +func (m *ImageMessage) GetUrl() string { + if m != nil && m.Url != nil { + return *m.Url + } + return "" +} + +func (m *ImageMessage) GetMimetype() string { + if m != nil && m.Mimetype != nil { + return *m.Mimetype + } + return "" +} + +func (m *ImageMessage) GetCaption() string { + if m != nil && m.Caption != nil { + return *m.Caption + } + return "" +} + +func (m *ImageMessage) GetFileSha256() []byte { + if m != nil { + return m.FileSha256 + } + return nil +} + +func (m *ImageMessage) GetFileLength() uint64 { + if m != nil && m.FileLength != nil { + return *m.FileLength + } + return 0 +} + +func (m *ImageMessage) GetHeight() uint32 { + if m != nil && m.Height != nil { + return *m.Height + } + return 0 +} + +func (m *ImageMessage) GetWidth() uint32 { + if m != nil && m.Width != nil { + return *m.Width + } + return 0 +} + +func (m *ImageMessage) GetMediaKey() []byte { + if m != nil { + return m.MediaKey + } + return nil +} + +func (m *ImageMessage) GetFileEncSha256() []byte { + if m != nil { + return m.FileEncSha256 + } + return nil +} + +func (m *ImageMessage) GetInteractiveAnnotations() []*InteractiveAnnotation { + if m != nil { + return m.InteractiveAnnotations + } + return nil +} + +func (m *ImageMessage) GetDirectPath() string { + if m != nil && m.DirectPath != nil { + return *m.DirectPath + } + return "" +} + +func (m *ImageMessage) GetJpegThumbnail() []byte { + if m != nil { + return m.JpegThumbnail + } + return nil +} + +func (m *ImageMessage) GetContextInfo() *ContextInfo { + if m != nil { + return m.ContextInfo + } + return nil +} + +func (m *ImageMessage) GetFirstScanSidecar() []byte { + if m != nil { + return m.FirstScanSidecar + } + return nil +} + +func (m *ImageMessage) GetFirstScanLength() uint32 { + if m != nil && m.FirstScanLength != nil { + return *m.FirstScanLength + } + return 0 +} + +type ContactMessage struct { + DisplayName *string `protobuf:"bytes,1,opt,name=displayName" json:"displayName,omitempty"` + Vcard *string `protobuf:"bytes,16,opt,name=vcard" json:"vcard,omitempty"` + ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ContactMessage) Reset() { *m = ContactMessage{} } +func (m *ContactMessage) String() string { return proto.CompactTextString(m) } +func (*ContactMessage) ProtoMessage() {} +func (*ContactMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{5} +} +func (m *ContactMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ContactMessage.Unmarshal(m, b) +} +func (m *ContactMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ContactMessage.Marshal(b, m, deterministic) +} +func (dst *ContactMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContactMessage.Merge(dst, src) +} +func (m *ContactMessage) XXX_Size() int { + return xxx_messageInfo_ContactMessage.Size(m) +} +func (m *ContactMessage) XXX_DiscardUnknown() { + xxx_messageInfo_ContactMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_ContactMessage proto.InternalMessageInfo + +func (m *ContactMessage) GetDisplayName() string { + if m != nil && m.DisplayName != nil { + return *m.DisplayName + } + return "" +} + +func (m *ContactMessage) GetVcard() string { + if m != nil && m.Vcard != nil { + return *m.Vcard + } + return "" +} + +func (m *ContactMessage) GetContextInfo() *ContextInfo { + if m != nil { + return m.ContextInfo + } + return nil +} + +type LocationMessage struct { + DegreesLatitude *float64 `protobuf:"fixed64,1,opt,name=degreesLatitude" json:"degreesLatitude,omitempty"` + DegreesLongitude *float64 `protobuf:"fixed64,2,opt,name=degreesLongitude" json:"degreesLongitude,omitempty"` + Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + Address *string `protobuf:"bytes,4,opt,name=address" json:"address,omitempty"` + Url *string `protobuf:"bytes,5,opt,name=url" json:"url,omitempty"` + JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` + ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LocationMessage) Reset() { *m = LocationMessage{} } +func (m *LocationMessage) String() string { return proto.CompactTextString(m) } +func (*LocationMessage) ProtoMessage() {} +func (*LocationMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{6} +} +func (m *LocationMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LocationMessage.Unmarshal(m, b) +} +func (m *LocationMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LocationMessage.Marshal(b, m, deterministic) +} +func (dst *LocationMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocationMessage.Merge(dst, src) +} +func (m *LocationMessage) XXX_Size() int { + return xxx_messageInfo_LocationMessage.Size(m) +} +func (m *LocationMessage) XXX_DiscardUnknown() { + xxx_messageInfo_LocationMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_LocationMessage proto.InternalMessageInfo + +func (m *LocationMessage) GetDegreesLatitude() float64 { + if m != nil && m.DegreesLatitude != nil { + return *m.DegreesLatitude + } + return 0 +} + +func (m *LocationMessage) GetDegreesLongitude() float64 { + if m != nil && m.DegreesLongitude != nil { + return *m.DegreesLongitude + } + return 0 +} + +func (m *LocationMessage) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *LocationMessage) GetAddress() string { + if m != nil && m.Address != nil { + return *m.Address + } + return "" +} + +func (m *LocationMessage) GetUrl() string { + if m != nil && m.Url != nil { + return *m.Url + } + return "" +} + +func (m *LocationMessage) GetJpegThumbnail() []byte { + if m != nil { + return m.JpegThumbnail + } + return nil +} + +func (m *LocationMessage) GetContextInfo() *ContextInfo { + if m != nil { + return m.ContextInfo + } + return nil +} + +type ExtendedTextMessage struct { + Text *string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + MatchedText *string `protobuf:"bytes,2,opt,name=matchedText" json:"matchedText,omitempty"` + CanonicalUrl *string `protobuf:"bytes,4,opt,name=canonicalUrl" json:"canonicalUrl,omitempty"` + Description *string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"` + Title *string `protobuf:"bytes,6,opt,name=title" json:"title,omitempty"` + TextArgb *uint32 `protobuf:"fixed32,7,opt,name=textArgb" json:"textArgb,omitempty"` + BackgroundArgb *uint32 `protobuf:"fixed32,8,opt,name=backgroundArgb" json:"backgroundArgb,omitempty"` + Font *ExtendedTextMessage_FONTTYPE `protobuf:"varint,9,opt,name=font,enum=proto.ExtendedTextMessage_FONTTYPE" json:"font,omitempty"` + JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` + ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ExtendedTextMessage) Reset() { *m = ExtendedTextMessage{} } +func (m *ExtendedTextMessage) String() string { return proto.CompactTextString(m) } +func (*ExtendedTextMessage) ProtoMessage() {} +func (*ExtendedTextMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{7} +} +func (m *ExtendedTextMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ExtendedTextMessage.Unmarshal(m, b) +} +func (m *ExtendedTextMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ExtendedTextMessage.Marshal(b, m, deterministic) +} +func (dst *ExtendedTextMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExtendedTextMessage.Merge(dst, src) +} +func (m *ExtendedTextMessage) XXX_Size() int { + return xxx_messageInfo_ExtendedTextMessage.Size(m) +} +func (m *ExtendedTextMessage) XXX_DiscardUnknown() { + xxx_messageInfo_ExtendedTextMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_ExtendedTextMessage proto.InternalMessageInfo + +func (m *ExtendedTextMessage) GetText() string { + if m != nil && m.Text != nil { + return *m.Text + } + return "" +} + +func (m *ExtendedTextMessage) GetMatchedText() string { + if m != nil && m.MatchedText != nil { + return *m.MatchedText + } + return "" +} + +func (m *ExtendedTextMessage) GetCanonicalUrl() string { + if m != nil && m.CanonicalUrl != nil { + return *m.CanonicalUrl + } + return "" +} + +func (m *ExtendedTextMessage) GetDescription() string { + if m != nil && m.Description != nil { + return *m.Description + } + return "" +} + +func (m *ExtendedTextMessage) GetTitle() string { + if m != nil && m.Title != nil { + return *m.Title + } + return "" +} + +func (m *ExtendedTextMessage) GetTextArgb() uint32 { + if m != nil && m.TextArgb != nil { + return *m.TextArgb + } + return 0 +} + +func (m *ExtendedTextMessage) GetBackgroundArgb() uint32 { + if m != nil && m.BackgroundArgb != nil { + return *m.BackgroundArgb + } + return 0 +} + +func (m *ExtendedTextMessage) GetFont() ExtendedTextMessage_FONTTYPE { + if m != nil && m.Font != nil { + return *m.Font + } + return ExtendedTextMessage_SANS_SERIF +} + +func (m *ExtendedTextMessage) GetJpegThumbnail() []byte { + if m != nil { + return m.JpegThumbnail + } + return nil +} + +func (m *ExtendedTextMessage) GetContextInfo() *ContextInfo { + if m != nil { + return m.ContextInfo + } + return nil +} + +type DocumentMessage struct { + Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + Mimetype *string `protobuf:"bytes,2,opt,name=mimetype" json:"mimetype,omitempty"` + Title *string `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` + FileSha256 []byte `protobuf:"bytes,4,opt,name=fileSha256" json:"fileSha256,omitempty"` + FileLength *uint64 `protobuf:"varint,5,opt,name=fileLength" json:"fileLength,omitempty"` + PageCount *uint32 `protobuf:"varint,6,opt,name=pageCount" json:"pageCount,omitempty"` + MediaKey []byte `protobuf:"bytes,7,opt,name=mediaKey" json:"mediaKey,omitempty"` + FileName *string `protobuf:"bytes,8,opt,name=fileName" json:"fileName,omitempty"` + FileEncSha256 []byte `protobuf:"bytes,9,opt,name=fileEncSha256" json:"fileEncSha256,omitempty"` + DirectPath *string `protobuf:"bytes,10,opt,name=directPath" json:"directPath,omitempty"` + JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` + ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DocumentMessage) Reset() { *m = DocumentMessage{} } +func (m *DocumentMessage) String() string { return proto.CompactTextString(m) } +func (*DocumentMessage) ProtoMessage() {} +func (*DocumentMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{8} +} +func (m *DocumentMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DocumentMessage.Unmarshal(m, b) +} +func (m *DocumentMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DocumentMessage.Marshal(b, m, deterministic) +} +func (dst *DocumentMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_DocumentMessage.Merge(dst, src) +} +func (m *DocumentMessage) XXX_Size() int { + return xxx_messageInfo_DocumentMessage.Size(m) +} +func (m *DocumentMessage) XXX_DiscardUnknown() { + xxx_messageInfo_DocumentMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_DocumentMessage proto.InternalMessageInfo + +func (m *DocumentMessage) GetUrl() string { + if m != nil && m.Url != nil { + return *m.Url + } + return "" +} + +func (m *DocumentMessage) GetMimetype() string { + if m != nil && m.Mimetype != nil { + return *m.Mimetype + } + return "" +} + +func (m *DocumentMessage) GetTitle() string { + if m != nil && m.Title != nil { + return *m.Title + } + return "" +} + +func (m *DocumentMessage) GetFileSha256() []byte { + if m != nil { + return m.FileSha256 + } + return nil +} + +func (m *DocumentMessage) GetFileLength() uint64 { + if m != nil && m.FileLength != nil { + return *m.FileLength + } + return 0 +} + +func (m *DocumentMessage) GetPageCount() uint32 { + if m != nil && m.PageCount != nil { + return *m.PageCount + } + return 0 +} + +func (m *DocumentMessage) GetMediaKey() []byte { + if m != nil { + return m.MediaKey + } + return nil +} + +func (m *DocumentMessage) GetFileName() string { + if m != nil && m.FileName != nil { + return *m.FileName + } + return "" +} + +func (m *DocumentMessage) GetFileEncSha256() []byte { + if m != nil { + return m.FileEncSha256 + } + return nil +} + +func (m *DocumentMessage) GetDirectPath() string { + if m != nil && m.DirectPath != nil { + return *m.DirectPath + } + return "" +} + +func (m *DocumentMessage) GetJpegThumbnail() []byte { + if m != nil { + return m.JpegThumbnail + } + return nil +} + +func (m *DocumentMessage) GetContextInfo() *ContextInfo { + if m != nil { + return m.ContextInfo + } + return nil +} + +type AudioMessage struct { + Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + Mimetype *string `protobuf:"bytes,2,opt,name=mimetype" json:"mimetype,omitempty"` + FileSha256 []byte `protobuf:"bytes,3,opt,name=fileSha256" json:"fileSha256,omitempty"` + FileLength *uint64 `protobuf:"varint,4,opt,name=fileLength" json:"fileLength,omitempty"` + Seconds *uint32 `protobuf:"varint,5,opt,name=seconds" json:"seconds,omitempty"` + Ptt *bool `protobuf:"varint,6,opt,name=ptt" json:"ptt,omitempty"` + MediaKey []byte `protobuf:"bytes,7,opt,name=mediaKey" json:"mediaKey,omitempty"` + FileEncSha256 []byte `protobuf:"bytes,8,opt,name=fileEncSha256" json:"fileEncSha256,omitempty"` + DirectPath *string `protobuf:"bytes,9,opt,name=directPath" json:"directPath,omitempty"` + ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` + StreamingSidecar []byte `protobuf:"bytes,18,opt,name=streamingSidecar" json:"streamingSidecar,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AudioMessage) Reset() { *m = AudioMessage{} } +func (m *AudioMessage) String() string { return proto.CompactTextString(m) } +func (*AudioMessage) ProtoMessage() {} +func (*AudioMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{9} +} +func (m *AudioMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AudioMessage.Unmarshal(m, b) +} +func (m *AudioMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AudioMessage.Marshal(b, m, deterministic) +} +func (dst *AudioMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_AudioMessage.Merge(dst, src) +} +func (m *AudioMessage) XXX_Size() int { + return xxx_messageInfo_AudioMessage.Size(m) +} +func (m *AudioMessage) XXX_DiscardUnknown() { + xxx_messageInfo_AudioMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_AudioMessage proto.InternalMessageInfo + +func (m *AudioMessage) GetUrl() string { + if m != nil && m.Url != nil { + return *m.Url + } + return "" +} + +func (m *AudioMessage) GetMimetype() string { + if m != nil && m.Mimetype != nil { + return *m.Mimetype + } + return "" +} + +func (m *AudioMessage) GetFileSha256() []byte { + if m != nil { + return m.FileSha256 + } + return nil +} + +func (m *AudioMessage) GetFileLength() uint64 { + if m != nil && m.FileLength != nil { + return *m.FileLength + } + return 0 +} + +func (m *AudioMessage) GetSeconds() uint32 { + if m != nil && m.Seconds != nil { + return *m.Seconds + } + return 0 +} + +func (m *AudioMessage) GetPtt() bool { + if m != nil && m.Ptt != nil { + return *m.Ptt + } + return false +} + +func (m *AudioMessage) GetMediaKey() []byte { + if m != nil { + return m.MediaKey + } + return nil +} + +func (m *AudioMessage) GetFileEncSha256() []byte { + if m != nil { + return m.FileEncSha256 + } + return nil +} + +func (m *AudioMessage) GetDirectPath() string { + if m != nil && m.DirectPath != nil { + return *m.DirectPath + } + return "" +} + +func (m *AudioMessage) GetContextInfo() *ContextInfo { + if m != nil { + return m.ContextInfo + } + return nil +} + +func (m *AudioMessage) GetStreamingSidecar() []byte { + if m != nil { + return m.StreamingSidecar + } + return nil +} + +type VideoMessage struct { + Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + Mimetype *string `protobuf:"bytes,2,opt,name=mimetype" json:"mimetype,omitempty"` + FileSha256 []byte `protobuf:"bytes,3,opt,name=fileSha256" json:"fileSha256,omitempty"` + FileLength *uint64 `protobuf:"varint,4,opt,name=fileLength" json:"fileLength,omitempty"` + Seconds *uint32 `protobuf:"varint,5,opt,name=seconds" json:"seconds,omitempty"` + MediaKey []byte `protobuf:"bytes,6,opt,name=mediaKey" json:"mediaKey,omitempty"` + Caption *string `protobuf:"bytes,7,opt,name=caption" json:"caption,omitempty"` + GifPlayback *bool `protobuf:"varint,8,opt,name=gifPlayback" json:"gifPlayback,omitempty"` + Height *uint32 `protobuf:"varint,9,opt,name=height" json:"height,omitempty"` + Width *uint32 `protobuf:"varint,10,opt,name=width" json:"width,omitempty"` + FileEncSha256 []byte `protobuf:"bytes,11,opt,name=fileEncSha256" json:"fileEncSha256,omitempty"` + InteractiveAnnotations []*InteractiveAnnotation `protobuf:"bytes,12,rep,name=interactiveAnnotations" json:"interactiveAnnotations,omitempty"` + DirectPath *string `protobuf:"bytes,13,opt,name=directPath" json:"directPath,omitempty"` + JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` + ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` + StreamingSidecar []byte `protobuf:"bytes,18,opt,name=streamingSidecar" json:"streamingSidecar,omitempty"` + GifAttribution *VideoMessage_ATTRIBUTION `protobuf:"varint,19,opt,name=gifAttribution,enum=proto.VideoMessage_ATTRIBUTION" json:"gifAttribution,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VideoMessage) Reset() { *m = VideoMessage{} } +func (m *VideoMessage) String() string { return proto.CompactTextString(m) } +func (*VideoMessage) ProtoMessage() {} +func (*VideoMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{10} +} +func (m *VideoMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VideoMessage.Unmarshal(m, b) +} +func (m *VideoMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VideoMessage.Marshal(b, m, deterministic) +} +func (dst *VideoMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_VideoMessage.Merge(dst, src) +} +func (m *VideoMessage) XXX_Size() int { + return xxx_messageInfo_VideoMessage.Size(m) +} +func (m *VideoMessage) XXX_DiscardUnknown() { + xxx_messageInfo_VideoMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_VideoMessage proto.InternalMessageInfo + +func (m *VideoMessage) GetUrl() string { + if m != nil && m.Url != nil { + return *m.Url + } + return "" +} + +func (m *VideoMessage) GetMimetype() string { + if m != nil && m.Mimetype != nil { + return *m.Mimetype + } + return "" +} + +func (m *VideoMessage) GetFileSha256() []byte { + if m != nil { + return m.FileSha256 + } + return nil +} + +func (m *VideoMessage) GetFileLength() uint64 { + if m != nil && m.FileLength != nil { + return *m.FileLength + } + return 0 +} + +func (m *VideoMessage) GetSeconds() uint32 { + if m != nil && m.Seconds != nil { + return *m.Seconds + } + return 0 +} + +func (m *VideoMessage) GetMediaKey() []byte { + if m != nil { + return m.MediaKey + } + return nil +} + +func (m *VideoMessage) GetCaption() string { + if m != nil && m.Caption != nil { + return *m.Caption + } + return "" +} + +func (m *VideoMessage) GetGifPlayback() bool { + if m != nil && m.GifPlayback != nil { + return *m.GifPlayback + } + return false +} + +func (m *VideoMessage) GetHeight() uint32 { + if m != nil && m.Height != nil { + return *m.Height + } + return 0 +} + +func (m *VideoMessage) GetWidth() uint32 { + if m != nil && m.Width != nil { + return *m.Width + } + return 0 +} + +func (m *VideoMessage) GetFileEncSha256() []byte { + if m != nil { + return m.FileEncSha256 + } + return nil +} + +func (m *VideoMessage) GetInteractiveAnnotations() []*InteractiveAnnotation { + if m != nil { + return m.InteractiveAnnotations + } + return nil +} + +func (m *VideoMessage) GetDirectPath() string { + if m != nil && m.DirectPath != nil { + return *m.DirectPath + } + return "" +} + +func (m *VideoMessage) GetJpegThumbnail() []byte { + if m != nil { + return m.JpegThumbnail + } + return nil +} + +func (m *VideoMessage) GetContextInfo() *ContextInfo { + if m != nil { + return m.ContextInfo + } + return nil +} + +func (m *VideoMessage) GetStreamingSidecar() []byte { + if m != nil { + return m.StreamingSidecar + } + return nil +} + +func (m *VideoMessage) GetGifAttribution() VideoMessage_ATTRIBUTION { + if m != nil && m.GifAttribution != nil { + return *m.GifAttribution + } + return VideoMessage_NONE +} + +type Call struct { + CallKey []byte `protobuf:"bytes,1,opt,name=callKey" json:"callKey,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Call) Reset() { *m = Call{} } +func (m *Call) String() string { return proto.CompactTextString(m) } +func (*Call) ProtoMessage() {} +func (*Call) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{11} +} +func (m *Call) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Call.Unmarshal(m, b) +} +func (m *Call) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Call.Marshal(b, m, deterministic) +} +func (dst *Call) XXX_Merge(src proto.Message) { + xxx_messageInfo_Call.Merge(dst, src) +} +func (m *Call) XXX_Size() int { + return xxx_messageInfo_Call.Size(m) +} +func (m *Call) XXX_DiscardUnknown() { + xxx_messageInfo_Call.DiscardUnknown(m) +} + +var xxx_messageInfo_Call proto.InternalMessageInfo + +func (m *Call) GetCallKey() []byte { + if m != nil { + return m.CallKey + } + return nil +} + +type Chat struct { + DisplayName *string `protobuf:"bytes,1,opt,name=displayName" json:"displayName,omitempty"` + Id *string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Chat) Reset() { *m = Chat{} } +func (m *Chat) String() string { return proto.CompactTextString(m) } +func (*Chat) ProtoMessage() {} +func (*Chat) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{12} +} +func (m *Chat) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Chat.Unmarshal(m, b) +} +func (m *Chat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Chat.Marshal(b, m, deterministic) +} +func (dst *Chat) XXX_Merge(src proto.Message) { + xxx_messageInfo_Chat.Merge(dst, src) +} +func (m *Chat) XXX_Size() int { + return xxx_messageInfo_Chat.Size(m) +} +func (m *Chat) XXX_DiscardUnknown() { + xxx_messageInfo_Chat.DiscardUnknown(m) +} + +var xxx_messageInfo_Chat proto.InternalMessageInfo + +func (m *Chat) GetDisplayName() string { + if m != nil && m.DisplayName != nil { + return *m.DisplayName + } + return "" +} + +func (m *Chat) GetId() string { + if m != nil && m.Id != nil { + return *m.Id + } + return "" +} + +type ProtocolMessage struct { + Key *MessageKey `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + Type *ProtocolMessage_TYPE `protobuf:"varint,2,opt,name=type,enum=proto.ProtocolMessage_TYPE" json:"type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProtocolMessage) Reset() { *m = ProtocolMessage{} } +func (m *ProtocolMessage) String() string { return proto.CompactTextString(m) } +func (*ProtocolMessage) ProtoMessage() {} +func (*ProtocolMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{13} +} +func (m *ProtocolMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProtocolMessage.Unmarshal(m, b) +} +func (m *ProtocolMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProtocolMessage.Marshal(b, m, deterministic) +} +func (dst *ProtocolMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProtocolMessage.Merge(dst, src) +} +func (m *ProtocolMessage) XXX_Size() int { + return xxx_messageInfo_ProtocolMessage.Size(m) +} +func (m *ProtocolMessage) XXX_DiscardUnknown() { + xxx_messageInfo_ProtocolMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_ProtocolMessage proto.InternalMessageInfo + +func (m *ProtocolMessage) GetKey() *MessageKey { + if m != nil { + return m.Key + } + return nil +} + +func (m *ProtocolMessage) GetType() ProtocolMessage_TYPE { + if m != nil && m.Type != nil { + return *m.Type + } + return ProtocolMessage_REVOKE +} + +type ContactsArrayMessage struct { + DisplayName *string `protobuf:"bytes,1,opt,name=displayName" json:"displayName,omitempty"` + Contacts []*ContactMessage `protobuf:"bytes,2,rep,name=contacts" json:"contacts,omitempty"` + ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ContactsArrayMessage) Reset() { *m = ContactsArrayMessage{} } +func (m *ContactsArrayMessage) String() string { return proto.CompactTextString(m) } +func (*ContactsArrayMessage) ProtoMessage() {} +func (*ContactsArrayMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{14} +} +func (m *ContactsArrayMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ContactsArrayMessage.Unmarshal(m, b) +} +func (m *ContactsArrayMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ContactsArrayMessage.Marshal(b, m, deterministic) +} +func (dst *ContactsArrayMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContactsArrayMessage.Merge(dst, src) +} +func (m *ContactsArrayMessage) XXX_Size() int { + return xxx_messageInfo_ContactsArrayMessage.Size(m) +} +func (m *ContactsArrayMessage) XXX_DiscardUnknown() { + xxx_messageInfo_ContactsArrayMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_ContactsArrayMessage proto.InternalMessageInfo + +func (m *ContactsArrayMessage) GetDisplayName() string { + if m != nil && m.DisplayName != nil { + return *m.DisplayName + } + return "" +} + +func (m *ContactsArrayMessage) GetContacts() []*ContactMessage { + if m != nil { + return m.Contacts + } + return nil +} + +func (m *ContactsArrayMessage) GetContextInfo() *ContextInfo { + if m != nil { + return m.ContextInfo + } + return nil +} + +type HSMCurrency struct { + CurrencyCode *string `protobuf:"bytes,1,opt,name=currencyCode" json:"currencyCode,omitempty"` + Amount1000 *int64 `protobuf:"varint,2,opt,name=amount1000" json:"amount1000,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HSMCurrency) Reset() { *m = HSMCurrency{} } +func (m *HSMCurrency) String() string { return proto.CompactTextString(m) } +func (*HSMCurrency) ProtoMessage() {} +func (*HSMCurrency) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{15} +} +func (m *HSMCurrency) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_HSMCurrency.Unmarshal(m, b) +} +func (m *HSMCurrency) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_HSMCurrency.Marshal(b, m, deterministic) +} +func (dst *HSMCurrency) XXX_Merge(src proto.Message) { + xxx_messageInfo_HSMCurrency.Merge(dst, src) +} +func (m *HSMCurrency) XXX_Size() int { + return xxx_messageInfo_HSMCurrency.Size(m) +} +func (m *HSMCurrency) XXX_DiscardUnknown() { + xxx_messageInfo_HSMCurrency.DiscardUnknown(m) +} + +var xxx_messageInfo_HSMCurrency proto.InternalMessageInfo + +func (m *HSMCurrency) GetCurrencyCode() string { + if m != nil && m.CurrencyCode != nil { + return *m.CurrencyCode + } + return "" +} + +func (m *HSMCurrency) GetAmount1000() int64 { + if m != nil && m.Amount1000 != nil { + return *m.Amount1000 + } + return 0 +} + +type HSMDateTimeComponent struct { + DayOfWeek *HSMDateTimeComponent_DAYOFWEEKTYPE `protobuf:"varint,1,opt,name=dayOfWeek,enum=proto.HSMDateTimeComponent_DAYOFWEEKTYPE" json:"dayOfWeek,omitempty"` + Year *uint32 `protobuf:"varint,2,opt,name=year" json:"year,omitempty"` + Month *uint32 `protobuf:"varint,3,opt,name=month" json:"month,omitempty"` + DayOfMonth *uint32 `protobuf:"varint,4,opt,name=dayOfMonth" json:"dayOfMonth,omitempty"` + Hour *uint32 `protobuf:"varint,5,opt,name=hour" json:"hour,omitempty"` + Minute *uint32 `protobuf:"varint,6,opt,name=minute" json:"minute,omitempty"` + Calendar *HSMDateTimeComponent_CALENDARTYPE `protobuf:"varint,7,opt,name=calendar,enum=proto.HSMDateTimeComponent_CALENDARTYPE" json:"calendar,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HSMDateTimeComponent) Reset() { *m = HSMDateTimeComponent{} } +func (m *HSMDateTimeComponent) String() string { return proto.CompactTextString(m) } +func (*HSMDateTimeComponent) ProtoMessage() {} +func (*HSMDateTimeComponent) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{16} +} +func (m *HSMDateTimeComponent) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_HSMDateTimeComponent.Unmarshal(m, b) +} +func (m *HSMDateTimeComponent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_HSMDateTimeComponent.Marshal(b, m, deterministic) +} +func (dst *HSMDateTimeComponent) XXX_Merge(src proto.Message) { + xxx_messageInfo_HSMDateTimeComponent.Merge(dst, src) +} +func (m *HSMDateTimeComponent) XXX_Size() int { + return xxx_messageInfo_HSMDateTimeComponent.Size(m) +} +func (m *HSMDateTimeComponent) XXX_DiscardUnknown() { + xxx_messageInfo_HSMDateTimeComponent.DiscardUnknown(m) +} + +var xxx_messageInfo_HSMDateTimeComponent proto.InternalMessageInfo + +func (m *HSMDateTimeComponent) GetDayOfWeek() HSMDateTimeComponent_DAYOFWEEKTYPE { + if m != nil && m.DayOfWeek != nil { + return *m.DayOfWeek + } + return HSMDateTimeComponent_MONDAY +} + +func (m *HSMDateTimeComponent) GetYear() uint32 { + if m != nil && m.Year != nil { + return *m.Year + } + return 0 +} + +func (m *HSMDateTimeComponent) GetMonth() uint32 { + if m != nil && m.Month != nil { + return *m.Month + } + return 0 +} + +func (m *HSMDateTimeComponent) GetDayOfMonth() uint32 { + if m != nil && m.DayOfMonth != nil { + return *m.DayOfMonth + } + return 0 +} + +func (m *HSMDateTimeComponent) GetHour() uint32 { + if m != nil && m.Hour != nil { + return *m.Hour + } + return 0 +} + +func (m *HSMDateTimeComponent) GetMinute() uint32 { + if m != nil && m.Minute != nil { + return *m.Minute + } + return 0 +} + +func (m *HSMDateTimeComponent) GetCalendar() HSMDateTimeComponent_CALENDARTYPE { + if m != nil && m.Calendar != nil { + return *m.Calendar + } + return HSMDateTimeComponent_GREGORIAN +} + +type HSMDateTimeUnixEpoch struct { + Timestamp *int64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HSMDateTimeUnixEpoch) Reset() { *m = HSMDateTimeUnixEpoch{} } +func (m *HSMDateTimeUnixEpoch) String() string { return proto.CompactTextString(m) } +func (*HSMDateTimeUnixEpoch) ProtoMessage() {} +func (*HSMDateTimeUnixEpoch) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{17} +} +func (m *HSMDateTimeUnixEpoch) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_HSMDateTimeUnixEpoch.Unmarshal(m, b) +} +func (m *HSMDateTimeUnixEpoch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_HSMDateTimeUnixEpoch.Marshal(b, m, deterministic) +} +func (dst *HSMDateTimeUnixEpoch) XXX_Merge(src proto.Message) { + xxx_messageInfo_HSMDateTimeUnixEpoch.Merge(dst, src) +} +func (m *HSMDateTimeUnixEpoch) XXX_Size() int { + return xxx_messageInfo_HSMDateTimeUnixEpoch.Size(m) +} +func (m *HSMDateTimeUnixEpoch) XXX_DiscardUnknown() { + xxx_messageInfo_HSMDateTimeUnixEpoch.DiscardUnknown(m) +} + +var xxx_messageInfo_HSMDateTimeUnixEpoch proto.InternalMessageInfo + +func (m *HSMDateTimeUnixEpoch) GetTimestamp() int64 { + if m != nil && m.Timestamp != nil { + return *m.Timestamp + } + return 0 +} + +type HSMDateTime struct { + // Types that are valid to be assigned to DatetimeOneof: + // *HSMDateTime_Component + // *HSMDateTime_UnixEpoch + DatetimeOneof isHSMDateTime_DatetimeOneof `protobuf_oneof:"datetimeOneof"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HSMDateTime) Reset() { *m = HSMDateTime{} } +func (m *HSMDateTime) String() string { return proto.CompactTextString(m) } +func (*HSMDateTime) ProtoMessage() {} +func (*HSMDateTime) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{18} +} +func (m *HSMDateTime) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_HSMDateTime.Unmarshal(m, b) +} +func (m *HSMDateTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_HSMDateTime.Marshal(b, m, deterministic) +} +func (dst *HSMDateTime) XXX_Merge(src proto.Message) { + xxx_messageInfo_HSMDateTime.Merge(dst, src) +} +func (m *HSMDateTime) XXX_Size() int { + return xxx_messageInfo_HSMDateTime.Size(m) +} +func (m *HSMDateTime) XXX_DiscardUnknown() { + xxx_messageInfo_HSMDateTime.DiscardUnknown(m) +} + +var xxx_messageInfo_HSMDateTime proto.InternalMessageInfo + +type isHSMDateTime_DatetimeOneof interface { + isHSMDateTime_DatetimeOneof() +} + +type HSMDateTime_Component struct { + Component *HSMDateTimeComponent `protobuf:"bytes,1,opt,name=component,oneof"` +} +type HSMDateTime_UnixEpoch struct { + UnixEpoch *HSMDateTimeUnixEpoch `protobuf:"bytes,2,opt,name=unixEpoch,oneof"` +} + +func (*HSMDateTime_Component) isHSMDateTime_DatetimeOneof() {} +func (*HSMDateTime_UnixEpoch) isHSMDateTime_DatetimeOneof() {} + +func (m *HSMDateTime) GetDatetimeOneof() isHSMDateTime_DatetimeOneof { + if m != nil { + return m.DatetimeOneof + } + return nil +} + +func (m *HSMDateTime) GetComponent() *HSMDateTimeComponent { + if x, ok := m.GetDatetimeOneof().(*HSMDateTime_Component); ok { + return x.Component + } + return nil +} + +func (m *HSMDateTime) GetUnixEpoch() *HSMDateTimeUnixEpoch { + if x, ok := m.GetDatetimeOneof().(*HSMDateTime_UnixEpoch); ok { + return x.UnixEpoch + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*HSMDateTime) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _HSMDateTime_OneofMarshaler, _HSMDateTime_OneofUnmarshaler, _HSMDateTime_OneofSizer, []interface{}{ + (*HSMDateTime_Component)(nil), + (*HSMDateTime_UnixEpoch)(nil), + } +} + +func _HSMDateTime_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*HSMDateTime) + // datetimeOneof + switch x := m.DatetimeOneof.(type) { + case *HSMDateTime_Component: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Component); err != nil { + return err + } + case *HSMDateTime_UnixEpoch: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.UnixEpoch); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("HSMDateTime.DatetimeOneof has unexpected type %T", x) + } + return nil +} + +func _HSMDateTime_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*HSMDateTime) + switch tag { + case 1: // datetimeOneof.component + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(HSMDateTimeComponent) + err := b.DecodeMessage(msg) + m.DatetimeOneof = &HSMDateTime_Component{msg} + return true, err + case 2: // datetimeOneof.unixEpoch + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(HSMDateTimeUnixEpoch) + err := b.DecodeMessage(msg) + m.DatetimeOneof = &HSMDateTime_UnixEpoch{msg} + return true, err + default: + return false, nil + } +} + +func _HSMDateTime_OneofSizer(msg proto.Message) (n int) { + m := msg.(*HSMDateTime) + // datetimeOneof + switch x := m.DatetimeOneof.(type) { + case *HSMDateTime_Component: + s := proto.Size(x.Component) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *HSMDateTime_UnixEpoch: + s := proto.Size(x.UnixEpoch) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type HSMLocalizableParameter struct { + Default *string `protobuf:"bytes,1,opt,name=default" json:"default,omitempty"` + // Types that are valid to be assigned to ParamOneof: + // *HSMLocalizableParameter_Currency + // *HSMLocalizableParameter_DateTime + ParamOneof isHSMLocalizableParameter_ParamOneof `protobuf_oneof:"paramOneof"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HSMLocalizableParameter) Reset() { *m = HSMLocalizableParameter{} } +func (m *HSMLocalizableParameter) String() string { return proto.CompactTextString(m) } +func (*HSMLocalizableParameter) ProtoMessage() {} +func (*HSMLocalizableParameter) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{19} +} +func (m *HSMLocalizableParameter) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_HSMLocalizableParameter.Unmarshal(m, b) +} +func (m *HSMLocalizableParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_HSMLocalizableParameter.Marshal(b, m, deterministic) +} +func (dst *HSMLocalizableParameter) XXX_Merge(src proto.Message) { + xxx_messageInfo_HSMLocalizableParameter.Merge(dst, src) +} +func (m *HSMLocalizableParameter) XXX_Size() int { + return xxx_messageInfo_HSMLocalizableParameter.Size(m) +} +func (m *HSMLocalizableParameter) XXX_DiscardUnknown() { + xxx_messageInfo_HSMLocalizableParameter.DiscardUnknown(m) +} + +var xxx_messageInfo_HSMLocalizableParameter proto.InternalMessageInfo + +type isHSMLocalizableParameter_ParamOneof interface { + isHSMLocalizableParameter_ParamOneof() +} + +type HSMLocalizableParameter_Currency struct { + Currency *HSMCurrency `protobuf:"bytes,2,opt,name=currency,oneof"` +} +type HSMLocalizableParameter_DateTime struct { + DateTime *HSMDateTime `protobuf:"bytes,3,opt,name=dateTime,oneof"` +} + +func (*HSMLocalizableParameter_Currency) isHSMLocalizableParameter_ParamOneof() {} +func (*HSMLocalizableParameter_DateTime) isHSMLocalizableParameter_ParamOneof() {} + +func (m *HSMLocalizableParameter) GetParamOneof() isHSMLocalizableParameter_ParamOneof { + if m != nil { + return m.ParamOneof + } + return nil +} + +func (m *HSMLocalizableParameter) GetDefault() string { + if m != nil && m.Default != nil { + return *m.Default + } + return "" +} + +func (m *HSMLocalizableParameter) GetCurrency() *HSMCurrency { + if x, ok := m.GetParamOneof().(*HSMLocalizableParameter_Currency); ok { + return x.Currency + } + return nil +} + +func (m *HSMLocalizableParameter) GetDateTime() *HSMDateTime { + if x, ok := m.GetParamOneof().(*HSMLocalizableParameter_DateTime); ok { + return x.DateTime + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*HSMLocalizableParameter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _HSMLocalizableParameter_OneofMarshaler, _HSMLocalizableParameter_OneofUnmarshaler, _HSMLocalizableParameter_OneofSizer, []interface{}{ + (*HSMLocalizableParameter_Currency)(nil), + (*HSMLocalizableParameter_DateTime)(nil), + } +} + +func _HSMLocalizableParameter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*HSMLocalizableParameter) + // paramOneof + switch x := m.ParamOneof.(type) { + case *HSMLocalizableParameter_Currency: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Currency); err != nil { + return err + } + case *HSMLocalizableParameter_DateTime: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DateTime); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("HSMLocalizableParameter.ParamOneof has unexpected type %T", x) + } + return nil +} + +func _HSMLocalizableParameter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*HSMLocalizableParameter) + switch tag { + case 2: // paramOneof.currency + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(HSMCurrency) + err := b.DecodeMessage(msg) + m.ParamOneof = &HSMLocalizableParameter_Currency{msg} + return true, err + case 3: // paramOneof.dateTime + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(HSMDateTime) + err := b.DecodeMessage(msg) + m.ParamOneof = &HSMLocalizableParameter_DateTime{msg} + return true, err + default: + return false, nil + } +} + +func _HSMLocalizableParameter_OneofSizer(msg proto.Message) (n int) { + m := msg.(*HSMLocalizableParameter) + // paramOneof + switch x := m.ParamOneof.(type) { + case *HSMLocalizableParameter_Currency: + s := proto.Size(x.Currency) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *HSMLocalizableParameter_DateTime: + s := proto.Size(x.DateTime) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type HighlyStructuredMessage struct { + Namespace *string `protobuf:"bytes,1,opt,name=namespace" json:"namespace,omitempty"` + ElementName *string `protobuf:"bytes,2,opt,name=elementName" json:"elementName,omitempty"` + Params []string `protobuf:"bytes,3,rep,name=params" json:"params,omitempty"` + FallbackLg *string `protobuf:"bytes,4,opt,name=fallbackLg" json:"fallbackLg,omitempty"` + FallbackLc *string `protobuf:"bytes,5,opt,name=fallbackLc" json:"fallbackLc,omitempty"` + LocalizableParams []*HSMLocalizableParameter `protobuf:"bytes,6,rep,name=localizableParams" json:"localizableParams,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HighlyStructuredMessage) Reset() { *m = HighlyStructuredMessage{} } +func (m *HighlyStructuredMessage) String() string { return proto.CompactTextString(m) } +func (*HighlyStructuredMessage) ProtoMessage() {} +func (*HighlyStructuredMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{20} +} +func (m *HighlyStructuredMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_HighlyStructuredMessage.Unmarshal(m, b) +} +func (m *HighlyStructuredMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_HighlyStructuredMessage.Marshal(b, m, deterministic) +} +func (dst *HighlyStructuredMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_HighlyStructuredMessage.Merge(dst, src) +} +func (m *HighlyStructuredMessage) XXX_Size() int { + return xxx_messageInfo_HighlyStructuredMessage.Size(m) +} +func (m *HighlyStructuredMessage) XXX_DiscardUnknown() { + xxx_messageInfo_HighlyStructuredMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_HighlyStructuredMessage proto.InternalMessageInfo + +func (m *HighlyStructuredMessage) GetNamespace() string { + if m != nil && m.Namespace != nil { + return *m.Namespace + } + return "" +} + +func (m *HighlyStructuredMessage) GetElementName() string { + if m != nil && m.ElementName != nil { + return *m.ElementName + } + return "" +} + +func (m *HighlyStructuredMessage) GetParams() []string { + if m != nil { + return m.Params + } + return nil +} + +func (m *HighlyStructuredMessage) GetFallbackLg() string { + if m != nil && m.FallbackLg != nil { + return *m.FallbackLg + } + return "" +} + +func (m *HighlyStructuredMessage) GetFallbackLc() string { + if m != nil && m.FallbackLc != nil { + return *m.FallbackLc + } + return "" +} + +func (m *HighlyStructuredMessage) GetLocalizableParams() []*HSMLocalizableParameter { + if m != nil { + return m.LocalizableParams + } + return nil +} + +type SendPaymentMessage struct { + NoteMessage *Message `protobuf:"bytes,2,opt,name=noteMessage" json:"noteMessage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SendPaymentMessage) Reset() { *m = SendPaymentMessage{} } +func (m *SendPaymentMessage) String() string { return proto.CompactTextString(m) } +func (*SendPaymentMessage) ProtoMessage() {} +func (*SendPaymentMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{21} +} +func (m *SendPaymentMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SendPaymentMessage.Unmarshal(m, b) +} +func (m *SendPaymentMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SendPaymentMessage.Marshal(b, m, deterministic) +} +func (dst *SendPaymentMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendPaymentMessage.Merge(dst, src) +} +func (m *SendPaymentMessage) XXX_Size() int { + return xxx_messageInfo_SendPaymentMessage.Size(m) +} +func (m *SendPaymentMessage) XXX_DiscardUnknown() { + xxx_messageInfo_SendPaymentMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_SendPaymentMessage proto.InternalMessageInfo + +func (m *SendPaymentMessage) GetNoteMessage() *Message { + if m != nil { + return m.NoteMessage + } + return nil +} + +type RequestPaymentMessage struct { + CurrencyCodeIso4217 *string `protobuf:"bytes,1,opt,name=currencyCodeIso4217" json:"currencyCodeIso4217,omitempty"` + Amount1000 *uint64 `protobuf:"varint,2,opt,name=amount1000" json:"amount1000,omitempty"` + RequestFrom *string `protobuf:"bytes,3,opt,name=requestFrom" json:"requestFrom,omitempty"` + NoteMessage *Message `protobuf:"bytes,4,opt,name=noteMessage" json:"noteMessage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RequestPaymentMessage) Reset() { *m = RequestPaymentMessage{} } +func (m *RequestPaymentMessage) String() string { return proto.CompactTextString(m) } +func (*RequestPaymentMessage) ProtoMessage() {} +func (*RequestPaymentMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{22} +} +func (m *RequestPaymentMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RequestPaymentMessage.Unmarshal(m, b) +} +func (m *RequestPaymentMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RequestPaymentMessage.Marshal(b, m, deterministic) +} +func (dst *RequestPaymentMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestPaymentMessage.Merge(dst, src) +} +func (m *RequestPaymentMessage) XXX_Size() int { + return xxx_messageInfo_RequestPaymentMessage.Size(m) +} +func (m *RequestPaymentMessage) XXX_DiscardUnknown() { + xxx_messageInfo_RequestPaymentMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestPaymentMessage proto.InternalMessageInfo + +func (m *RequestPaymentMessage) GetCurrencyCodeIso4217() string { + if m != nil && m.CurrencyCodeIso4217 != nil { + return *m.CurrencyCodeIso4217 + } + return "" +} + +func (m *RequestPaymentMessage) GetAmount1000() uint64 { + if m != nil && m.Amount1000 != nil { + return *m.Amount1000 + } + return 0 +} + +func (m *RequestPaymentMessage) GetRequestFrom() string { + if m != nil && m.RequestFrom != nil { + return *m.RequestFrom + } + return "" +} + +func (m *RequestPaymentMessage) GetNoteMessage() *Message { + if m != nil { + return m.NoteMessage + } + return nil +} + +type LiveLocationMessage struct { + DegreesLatitude *float64 `protobuf:"fixed64,1,opt,name=degreesLatitude" json:"degreesLatitude,omitempty"` + DegreesLongitude *float64 `protobuf:"fixed64,2,opt,name=degreesLongitude" json:"degreesLongitude,omitempty"` + AccuracyInMeters *uint32 `protobuf:"varint,3,opt,name=accuracyInMeters" json:"accuracyInMeters,omitempty"` + SpeedInMps *float32 `protobuf:"fixed32,4,opt,name=speedInMps" json:"speedInMps,omitempty"` + DegreesClockwiseFromMagneticNorth *uint32 `protobuf:"varint,5,opt,name=degreesClockwiseFromMagneticNorth" json:"degreesClockwiseFromMagneticNorth,omitempty"` + Caption *string `protobuf:"bytes,6,opt,name=caption" json:"caption,omitempty"` + SequenceNumber *int64 `protobuf:"varint,7,opt,name=sequenceNumber" json:"sequenceNumber,omitempty"` + JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` + ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LiveLocationMessage) Reset() { *m = LiveLocationMessage{} } +func (m *LiveLocationMessage) String() string { return proto.CompactTextString(m) } +func (*LiveLocationMessage) ProtoMessage() {} +func (*LiveLocationMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{23} +} +func (m *LiveLocationMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LiveLocationMessage.Unmarshal(m, b) +} +func (m *LiveLocationMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LiveLocationMessage.Marshal(b, m, deterministic) +} +func (dst *LiveLocationMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_LiveLocationMessage.Merge(dst, src) +} +func (m *LiveLocationMessage) XXX_Size() int { + return xxx_messageInfo_LiveLocationMessage.Size(m) +} +func (m *LiveLocationMessage) XXX_DiscardUnknown() { + xxx_messageInfo_LiveLocationMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_LiveLocationMessage proto.InternalMessageInfo + +func (m *LiveLocationMessage) GetDegreesLatitude() float64 { + if m != nil && m.DegreesLatitude != nil { + return *m.DegreesLatitude + } + return 0 +} + +func (m *LiveLocationMessage) GetDegreesLongitude() float64 { + if m != nil && m.DegreesLongitude != nil { + return *m.DegreesLongitude + } + return 0 +} + +func (m *LiveLocationMessage) GetAccuracyInMeters() uint32 { + if m != nil && m.AccuracyInMeters != nil { + return *m.AccuracyInMeters + } + return 0 +} + +func (m *LiveLocationMessage) GetSpeedInMps() float32 { + if m != nil && m.SpeedInMps != nil { + return *m.SpeedInMps + } + return 0 +} + +func (m *LiveLocationMessage) GetDegreesClockwiseFromMagneticNorth() uint32 { + if m != nil && m.DegreesClockwiseFromMagneticNorth != nil { + return *m.DegreesClockwiseFromMagneticNorth + } + return 0 +} + +func (m *LiveLocationMessage) GetCaption() string { + if m != nil && m.Caption != nil { + return *m.Caption + } + return "" +} + +func (m *LiveLocationMessage) GetSequenceNumber() int64 { + if m != nil && m.SequenceNumber != nil { + return *m.SequenceNumber + } + return 0 +} + +func (m *LiveLocationMessage) GetJpegThumbnail() []byte { + if m != nil { + return m.JpegThumbnail + } + return nil +} + +func (m *LiveLocationMessage) GetContextInfo() *ContextInfo { + if m != nil { + return m.ContextInfo + } + return nil +} + +type StickerMessage struct { + Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + FileSha256 []byte `protobuf:"bytes,2,opt,name=fileSha256" json:"fileSha256,omitempty"` + FileEncSha256 []byte `protobuf:"bytes,3,opt,name=fileEncSha256" json:"fileEncSha256,omitempty"` + MediaKey []byte `protobuf:"bytes,4,opt,name=mediaKey" json:"mediaKey,omitempty"` + Mimetype *string `protobuf:"bytes,5,opt,name=mimetype" json:"mimetype,omitempty"` + Height *uint32 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` + Width *uint32 `protobuf:"varint,7,opt,name=width" json:"width,omitempty"` + DirectPath *string `protobuf:"bytes,8,opt,name=directPath" json:"directPath,omitempty"` + FileLength *uint64 `protobuf:"varint,9,opt,name=fileLength" json:"fileLength,omitempty"` + PngThumbnail []byte `protobuf:"bytes,16,opt,name=pngThumbnail" json:"pngThumbnail,omitempty"` + ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StickerMessage) Reset() { *m = StickerMessage{} } +func (m *StickerMessage) String() string { return proto.CompactTextString(m) } +func (*StickerMessage) ProtoMessage() {} +func (*StickerMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{24} +} +func (m *StickerMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StickerMessage.Unmarshal(m, b) +} +func (m *StickerMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StickerMessage.Marshal(b, m, deterministic) +} +func (dst *StickerMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_StickerMessage.Merge(dst, src) +} +func (m *StickerMessage) XXX_Size() int { + return xxx_messageInfo_StickerMessage.Size(m) +} +func (m *StickerMessage) XXX_DiscardUnknown() { + xxx_messageInfo_StickerMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_StickerMessage proto.InternalMessageInfo + +func (m *StickerMessage) GetUrl() string { + if m != nil && m.Url != nil { + return *m.Url + } + return "" +} + +func (m *StickerMessage) GetFileSha256() []byte { + if m != nil { + return m.FileSha256 + } + return nil +} + +func (m *StickerMessage) GetFileEncSha256() []byte { + if m != nil { + return m.FileEncSha256 + } + return nil +} + +func (m *StickerMessage) GetMediaKey() []byte { + if m != nil { + return m.MediaKey + } + return nil +} + +func (m *StickerMessage) GetMimetype() string { + if m != nil && m.Mimetype != nil { + return *m.Mimetype + } + return "" +} + +func (m *StickerMessage) GetHeight() uint32 { + if m != nil && m.Height != nil { + return *m.Height + } + return 0 +} + +func (m *StickerMessage) GetWidth() uint32 { + if m != nil && m.Width != nil { + return *m.Width + } + return 0 +} + +func (m *StickerMessage) GetDirectPath() string { + if m != nil && m.DirectPath != nil { + return *m.DirectPath + } + return "" +} + +func (m *StickerMessage) GetFileLength() uint64 { + if m != nil && m.FileLength != nil { + return *m.FileLength + } + return 0 +} + +func (m *StickerMessage) GetPngThumbnail() []byte { + if m != nil { + return m.PngThumbnail + } + return nil +} + +func (m *StickerMessage) GetContextInfo() *ContextInfo { + if m != nil { + return m.ContextInfo + } + return nil +} + +type Message struct { + Conversation *string `protobuf:"bytes,1,opt,name=conversation" json:"conversation,omitempty"` + SenderKeyDistributionMessage *SenderKeyDistributionMessage `protobuf:"bytes,2,opt,name=senderKeyDistributionMessage" json:"senderKeyDistributionMessage,omitempty"` + ImageMessage *ImageMessage `protobuf:"bytes,3,opt,name=imageMessage" json:"imageMessage,omitempty"` + ContactMessage *ContactMessage `protobuf:"bytes,4,opt,name=contactMessage" json:"contactMessage,omitempty"` + LocationMessage *LocationMessage `protobuf:"bytes,5,opt,name=locationMessage" json:"locationMessage,omitempty"` + ExtendedTextMessage *ExtendedTextMessage `protobuf:"bytes,6,opt,name=extendedTextMessage" json:"extendedTextMessage,omitempty"` + DocumentMessage *DocumentMessage `protobuf:"bytes,7,opt,name=documentMessage" json:"documentMessage,omitempty"` + AudioMessage *AudioMessage `protobuf:"bytes,8,opt,name=audioMessage" json:"audioMessage,omitempty"` + VideoMessage *VideoMessage `protobuf:"bytes,9,opt,name=videoMessage" json:"videoMessage,omitempty"` + Call *Call `protobuf:"bytes,10,opt,name=call" json:"call,omitempty"` + Chat *Chat `protobuf:"bytes,11,opt,name=chat" json:"chat,omitempty"` + ProtocolMessage *ProtocolMessage `protobuf:"bytes,12,opt,name=protocolMessage" json:"protocolMessage,omitempty"` + ContactsArrayMessage *ContactsArrayMessage `protobuf:"bytes,13,opt,name=contactsArrayMessage" json:"contactsArrayMessage,omitempty"` + HighlyStructuredMessage *HighlyStructuredMessage `protobuf:"bytes,14,opt,name=highlyStructuredMessage" json:"highlyStructuredMessage,omitempty"` + FastRatchetKeySenderKeyDistributionMessage *SenderKeyDistributionMessage `protobuf:"bytes,15,opt,name=fastRatchetKeySenderKeyDistributionMessage" json:"fastRatchetKeySenderKeyDistributionMessage,omitempty"` + SendPaymentMessage *SendPaymentMessage `protobuf:"bytes,16,opt,name=sendPaymentMessage" json:"sendPaymentMessage,omitempty"` + RequestPaymentMessage *RequestPaymentMessage `protobuf:"bytes,17,opt,name=requestPaymentMessage" json:"requestPaymentMessage,omitempty"` + LiveLocationMessage *LiveLocationMessage `protobuf:"bytes,18,opt,name=liveLocationMessage" json:"liveLocationMessage,omitempty"` + StickerMessage *StickerMessage `protobuf:"bytes,20,opt,name=stickerMessage" json:"stickerMessage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Message) Reset() { *m = Message{} } +func (m *Message) String() string { return proto.CompactTextString(m) } +func (*Message) ProtoMessage() {} +func (*Message) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{25} +} +func (m *Message) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Message.Unmarshal(m, b) +} +func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Message.Marshal(b, m, deterministic) +} +func (dst *Message) XXX_Merge(src proto.Message) { + xxx_messageInfo_Message.Merge(dst, src) +} +func (m *Message) XXX_Size() int { + return xxx_messageInfo_Message.Size(m) +} +func (m *Message) XXX_DiscardUnknown() { + xxx_messageInfo_Message.DiscardUnknown(m) +} + +var xxx_messageInfo_Message proto.InternalMessageInfo + +func (m *Message) GetConversation() string { + if m != nil && m.Conversation != nil { + return *m.Conversation + } + return "" +} + +func (m *Message) GetSenderKeyDistributionMessage() *SenderKeyDistributionMessage { + if m != nil { + return m.SenderKeyDistributionMessage + } + return nil +} + +func (m *Message) GetImageMessage() *ImageMessage { + if m != nil { + return m.ImageMessage + } + return nil +} + +func (m *Message) GetContactMessage() *ContactMessage { + if m != nil { + return m.ContactMessage + } + return nil +} + +func (m *Message) GetLocationMessage() *LocationMessage { + if m != nil { + return m.LocationMessage + } + return nil +} + +func (m *Message) GetExtendedTextMessage() *ExtendedTextMessage { + if m != nil { + return m.ExtendedTextMessage + } + return nil +} + +func (m *Message) GetDocumentMessage() *DocumentMessage { + if m != nil { + return m.DocumentMessage + } + return nil +} + +func (m *Message) GetAudioMessage() *AudioMessage { + if m != nil { + return m.AudioMessage + } + return nil +} + +func (m *Message) GetVideoMessage() *VideoMessage { + if m != nil { + return m.VideoMessage + } + return nil +} + +func (m *Message) GetCall() *Call { + if m != nil { + return m.Call + } + return nil +} + +func (m *Message) GetChat() *Chat { + if m != nil { + return m.Chat + } + return nil +} + +func (m *Message) GetProtocolMessage() *ProtocolMessage { + if m != nil { + return m.ProtocolMessage + } + return nil +} + +func (m *Message) GetContactsArrayMessage() *ContactsArrayMessage { + if m != nil { + return m.ContactsArrayMessage + } + return nil +} + +func (m *Message) GetHighlyStructuredMessage() *HighlyStructuredMessage { + if m != nil { + return m.HighlyStructuredMessage + } + return nil +} + +func (m *Message) GetFastRatchetKeySenderKeyDistributionMessage() *SenderKeyDistributionMessage { + if m != nil { + return m.FastRatchetKeySenderKeyDistributionMessage + } + return nil +} + +func (m *Message) GetSendPaymentMessage() *SendPaymentMessage { + if m != nil { + return m.SendPaymentMessage + } + return nil +} + +func (m *Message) GetRequestPaymentMessage() *RequestPaymentMessage { + if m != nil { + return m.RequestPaymentMessage + } + return nil +} + +func (m *Message) GetLiveLocationMessage() *LiveLocationMessage { + if m != nil { + return m.LiveLocationMessage + } + return nil +} + +func (m *Message) GetStickerMessage() *StickerMessage { + if m != nil { + return m.StickerMessage + } + return nil +} + +type ContextInfo struct { + StanzaId *string `protobuf:"bytes,1,opt,name=stanzaId" json:"stanzaId,omitempty"` + Participant *string `protobuf:"bytes,2,opt,name=participant" json:"participant,omitempty"` + QuotedMessage []*Message `protobuf:"bytes,3,rep,name=quotedMessage" json:"quotedMessage,omitempty"` + RemoteJid *string `protobuf:"bytes,4,opt,name=remoteJid" json:"remoteJid,omitempty"` + MentionedJid []string `protobuf:"bytes,15,rep,name=mentionedJid" json:"mentionedJid,omitempty"` + ConversionSource *string `protobuf:"bytes,18,opt,name=conversionSource" json:"conversionSource,omitempty"` + ConversionData []byte `protobuf:"bytes,19,opt,name=conversionData" json:"conversionData,omitempty"` + ConversionDelaySeconds *uint32 `protobuf:"varint,20,opt,name=conversionDelaySeconds" json:"conversionDelaySeconds,omitempty"` + IsForwarded *bool `protobuf:"varint,22,opt,name=isForwarded" json:"isForwarded,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ContextInfo) Reset() { *m = ContextInfo{} } +func (m *ContextInfo) String() string { return proto.CompactTextString(m) } +func (*ContextInfo) ProtoMessage() {} +func (*ContextInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{26} +} +func (m *ContextInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ContextInfo.Unmarshal(m, b) +} +func (m *ContextInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ContextInfo.Marshal(b, m, deterministic) +} +func (dst *ContextInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContextInfo.Merge(dst, src) +} +func (m *ContextInfo) XXX_Size() int { + return xxx_messageInfo_ContextInfo.Size(m) +} +func (m *ContextInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ContextInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ContextInfo proto.InternalMessageInfo + +func (m *ContextInfo) GetStanzaId() string { + if m != nil && m.StanzaId != nil { + return *m.StanzaId + } + return "" +} + +func (m *ContextInfo) GetParticipant() string { + if m != nil && m.Participant != nil { + return *m.Participant + } + return "" +} + +func (m *ContextInfo) GetQuotedMessage() []*Message { + if m != nil { + return m.QuotedMessage + } + return nil +} + +func (m *ContextInfo) GetRemoteJid() string { + if m != nil && m.RemoteJid != nil { + return *m.RemoteJid + } + return "" +} + +func (m *ContextInfo) GetMentionedJid() []string { + if m != nil { + return m.MentionedJid + } + return nil +} + +func (m *ContextInfo) GetConversionSource() string { + if m != nil && m.ConversionSource != nil { + return *m.ConversionSource + } + return "" +} + +func (m *ContextInfo) GetConversionData() []byte { + if m != nil { + return m.ConversionData + } + return nil +} + +func (m *ContextInfo) GetConversionDelaySeconds() uint32 { + if m != nil && m.ConversionDelaySeconds != nil { + return *m.ConversionDelaySeconds + } + return 0 +} + +func (m *ContextInfo) GetIsForwarded() bool { + if m != nil && m.IsForwarded != nil { + return *m.IsForwarded + } + return false +} + +type InteractiveAnnotation struct { + PolygonVertices []*Point `protobuf:"bytes,1,rep,name=polygonVertices" json:"polygonVertices,omitempty"` + // Types that are valid to be assigned to Action: + // *InteractiveAnnotation_Location + Action isInteractiveAnnotation_Action `protobuf_oneof:"action"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InteractiveAnnotation) Reset() { *m = InteractiveAnnotation{} } +func (m *InteractiveAnnotation) String() string { return proto.CompactTextString(m) } +func (*InteractiveAnnotation) ProtoMessage() {} +func (*InteractiveAnnotation) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{27} +} +func (m *InteractiveAnnotation) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InteractiveAnnotation.Unmarshal(m, b) +} +func (m *InteractiveAnnotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InteractiveAnnotation.Marshal(b, m, deterministic) +} +func (dst *InteractiveAnnotation) XXX_Merge(src proto.Message) { + xxx_messageInfo_InteractiveAnnotation.Merge(dst, src) +} +func (m *InteractiveAnnotation) XXX_Size() int { + return xxx_messageInfo_InteractiveAnnotation.Size(m) +} +func (m *InteractiveAnnotation) XXX_DiscardUnknown() { + xxx_messageInfo_InteractiveAnnotation.DiscardUnknown(m) +} + +var xxx_messageInfo_InteractiveAnnotation proto.InternalMessageInfo + +type isInteractiveAnnotation_Action interface { + isInteractiveAnnotation_Action() +} + +type InteractiveAnnotation_Location struct { + Location *Location `protobuf:"bytes,2,opt,name=location,oneof"` +} + +func (*InteractiveAnnotation_Location) isInteractiveAnnotation_Action() {} + +func (m *InteractiveAnnotation) GetAction() isInteractiveAnnotation_Action { + if m != nil { + return m.Action + } + return nil +} + +func (m *InteractiveAnnotation) GetPolygonVertices() []*Point { + if m != nil { + return m.PolygonVertices + } + return nil +} + +func (m *InteractiveAnnotation) GetLocation() *Location { + if x, ok := m.GetAction().(*InteractiveAnnotation_Location); ok { + return x.Location + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*InteractiveAnnotation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _InteractiveAnnotation_OneofMarshaler, _InteractiveAnnotation_OneofUnmarshaler, _InteractiveAnnotation_OneofSizer, []interface{}{ + (*InteractiveAnnotation_Location)(nil), + } +} + +func _InteractiveAnnotation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*InteractiveAnnotation) + // action + switch x := m.Action.(type) { + case *InteractiveAnnotation_Location: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Location); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("InteractiveAnnotation.Action has unexpected type %T", x) + } + return nil +} + +func _InteractiveAnnotation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*InteractiveAnnotation) + switch tag { + case 2: // action.location + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Location) + err := b.DecodeMessage(msg) + m.Action = &InteractiveAnnotation_Location{msg} + return true, err + default: + return false, nil + } +} + +func _InteractiveAnnotation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*InteractiveAnnotation) + // action + switch x := m.Action.(type) { + case *InteractiveAnnotation_Location: + s := proto.Size(x.Location) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type Point struct { + X *float64 `protobuf:"fixed64,3,opt,name=x" json:"x,omitempty"` + Y *float64 `protobuf:"fixed64,4,opt,name=y" json:"y,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Point) Reset() { *m = Point{} } +func (m *Point) String() string { return proto.CompactTextString(m) } +func (*Point) ProtoMessage() {} +func (*Point) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{28} +} +func (m *Point) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Point.Unmarshal(m, b) +} +func (m *Point) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Point.Marshal(b, m, deterministic) +} +func (dst *Point) XXX_Merge(src proto.Message) { + xxx_messageInfo_Point.Merge(dst, src) +} +func (m *Point) XXX_Size() int { + return xxx_messageInfo_Point.Size(m) +} +func (m *Point) XXX_DiscardUnknown() { + xxx_messageInfo_Point.DiscardUnknown(m) +} + +var xxx_messageInfo_Point proto.InternalMessageInfo + +func (m *Point) GetX() float64 { + if m != nil && m.X != nil { + return *m.X + } + return 0 +} + +func (m *Point) GetY() float64 { + if m != nil && m.Y != nil { + return *m.Y + } + return 0 +} + +type Location struct { + DegreesLatitude *float64 `protobuf:"fixed64,1,opt,name=degreesLatitude" json:"degreesLatitude,omitempty"` + DegreesLongitude *float64 `protobuf:"fixed64,2,opt,name=degreesLongitude" json:"degreesLongitude,omitempty"` + Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Location) Reset() { *m = Location{} } +func (m *Location) String() string { return proto.CompactTextString(m) } +func (*Location) ProtoMessage() {} +func (*Location) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{29} +} +func (m *Location) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Location.Unmarshal(m, b) +} +func (m *Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Location.Marshal(b, m, deterministic) +} +func (dst *Location) XXX_Merge(src proto.Message) { + xxx_messageInfo_Location.Merge(dst, src) +} +func (m *Location) XXX_Size() int { + return xxx_messageInfo_Location.Size(m) +} +func (m *Location) XXX_DiscardUnknown() { + xxx_messageInfo_Location.DiscardUnknown(m) +} + +var xxx_messageInfo_Location proto.InternalMessageInfo + +func (m *Location) GetDegreesLatitude() float64 { + if m != nil && m.DegreesLatitude != nil { + return *m.DegreesLatitude + } + return 0 +} + +func (m *Location) GetDegreesLongitude() float64 { + if m != nil && m.DegreesLongitude != nil { + return *m.DegreesLongitude + } + return 0 +} + +func (m *Location) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +type WebMessageInfo struct { + Key *MessageKey `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` + Message *Message `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + MessageTimestamp *uint64 `protobuf:"varint,3,opt,name=messageTimestamp" json:"messageTimestamp,omitempty"` + Status *WebMessageInfo_STATUS `protobuf:"varint,4,opt,name=status,enum=proto.WebMessageInfo_STATUS,def=1" json:"status,omitempty"` + Participant *string `protobuf:"bytes,5,opt,name=participant" json:"participant,omitempty"` + Ignore *bool `protobuf:"varint,16,opt,name=ignore" json:"ignore,omitempty"` + Starred *bool `protobuf:"varint,17,opt,name=starred" json:"starred,omitempty"` + Broadcast *bool `protobuf:"varint,18,opt,name=broadcast" json:"broadcast,omitempty"` + PushName *string `protobuf:"bytes,19,opt,name=pushName" json:"pushName,omitempty"` + MediaCiphertextSha256 []byte `protobuf:"bytes,20,opt,name=mediaCiphertextSha256" json:"mediaCiphertextSha256,omitempty"` + Multicast *bool `protobuf:"varint,21,opt,name=multicast" json:"multicast,omitempty"` + UrlText *bool `protobuf:"varint,22,opt,name=urlText" json:"urlText,omitempty"` + UrlNumber *bool `protobuf:"varint,23,opt,name=urlNumber" json:"urlNumber,omitempty"` + MessageStubType *WebMessageInfo_STUBTYPE `protobuf:"varint,24,opt,name=messageStubType,enum=proto.WebMessageInfo_STUBTYPE" json:"messageStubType,omitempty"` + ClearMedia *bool `protobuf:"varint,25,opt,name=clearMedia" json:"clearMedia,omitempty"` + MessageStubParameters []string `protobuf:"bytes,26,rep,name=messageStubParameters" json:"messageStubParameters,omitempty"` + Duration *uint32 `protobuf:"varint,27,opt,name=duration" json:"duration,omitempty"` + Labels []string `protobuf:"bytes,28,rep,name=labels" json:"labels,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WebMessageInfo) Reset() { *m = WebMessageInfo{} } +func (m *WebMessageInfo) String() string { return proto.CompactTextString(m) } +func (*WebMessageInfo) ProtoMessage() {} +func (*WebMessageInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{30} +} +func (m *WebMessageInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WebMessageInfo.Unmarshal(m, b) +} +func (m *WebMessageInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WebMessageInfo.Marshal(b, m, deterministic) +} +func (dst *WebMessageInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_WebMessageInfo.Merge(dst, src) +} +func (m *WebMessageInfo) XXX_Size() int { + return xxx_messageInfo_WebMessageInfo.Size(m) +} +func (m *WebMessageInfo) XXX_DiscardUnknown() { + xxx_messageInfo_WebMessageInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_WebMessageInfo proto.InternalMessageInfo + +const Default_WebMessageInfo_Status WebMessageInfo_STATUS = WebMessageInfo_PENDING + +func (m *WebMessageInfo) GetKey() *MessageKey { + if m != nil { + return m.Key + } + return nil +} + +func (m *WebMessageInfo) GetMessage() *Message { + if m != nil { + return m.Message + } + return nil +} + +func (m *WebMessageInfo) GetMessageTimestamp() uint64 { + if m != nil && m.MessageTimestamp != nil { + return *m.MessageTimestamp + } + return 0 +} + +func (m *WebMessageInfo) GetStatus() WebMessageInfo_STATUS { + if m != nil && m.Status != nil { + return *m.Status + } + return Default_WebMessageInfo_Status +} + +func (m *WebMessageInfo) GetParticipant() string { + if m != nil && m.Participant != nil { + return *m.Participant + } + return "" +} + +func (m *WebMessageInfo) GetIgnore() bool { + if m != nil && m.Ignore != nil { + return *m.Ignore + } + return false +} + +func (m *WebMessageInfo) GetStarred() bool { + if m != nil && m.Starred != nil { + return *m.Starred + } + return false +} + +func (m *WebMessageInfo) GetBroadcast() bool { + if m != nil && m.Broadcast != nil { + return *m.Broadcast + } + return false +} + +func (m *WebMessageInfo) GetPushName() string { + if m != nil && m.PushName != nil { + return *m.PushName + } + return "" +} + +func (m *WebMessageInfo) GetMediaCiphertextSha256() []byte { + if m != nil { + return m.MediaCiphertextSha256 + } + return nil +} + +func (m *WebMessageInfo) GetMulticast() bool { + if m != nil && m.Multicast != nil { + return *m.Multicast + } + return false +} + +func (m *WebMessageInfo) GetUrlText() bool { + if m != nil && m.UrlText != nil { + return *m.UrlText + } + return false +} + +func (m *WebMessageInfo) GetUrlNumber() bool { + if m != nil && m.UrlNumber != nil { + return *m.UrlNumber + } + return false +} + +func (m *WebMessageInfo) GetMessageStubType() WebMessageInfo_STUBTYPE { + if m != nil && m.MessageStubType != nil { + return *m.MessageStubType + } + return WebMessageInfo_UNKNOWN +} + +func (m *WebMessageInfo) GetClearMedia() bool { + if m != nil && m.ClearMedia != nil { + return *m.ClearMedia + } + return false +} + +func (m *WebMessageInfo) GetMessageStubParameters() []string { + if m != nil { + return m.MessageStubParameters + } + return nil +} + +func (m *WebMessageInfo) GetDuration() uint32 { + if m != nil && m.Duration != nil { + return *m.Duration + } + return 0 +} + +func (m *WebMessageInfo) GetLabels() []string { + if m != nil { + return m.Labels + } + return nil +} + +type WebNotificationsInfo struct { + Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` + UnreadChats *uint32 `protobuf:"varint,3,opt,name=unreadChats" json:"unreadChats,omitempty"` + NotifyMessageCount *uint32 `protobuf:"varint,4,opt,name=notifyMessageCount" json:"notifyMessageCount,omitempty"` + NotifyMessages []*Message `protobuf:"bytes,5,rep,name=notifyMessages" json:"notifyMessages,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WebNotificationsInfo) Reset() { *m = WebNotificationsInfo{} } +func (m *WebNotificationsInfo) String() string { return proto.CompactTextString(m) } +func (*WebNotificationsInfo) ProtoMessage() {} +func (*WebNotificationsInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{31} +} +func (m *WebNotificationsInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WebNotificationsInfo.Unmarshal(m, b) +} +func (m *WebNotificationsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WebNotificationsInfo.Marshal(b, m, deterministic) +} +func (dst *WebNotificationsInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_WebNotificationsInfo.Merge(dst, src) +} +func (m *WebNotificationsInfo) XXX_Size() int { + return xxx_messageInfo_WebNotificationsInfo.Size(m) +} +func (m *WebNotificationsInfo) XXX_DiscardUnknown() { + xxx_messageInfo_WebNotificationsInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_WebNotificationsInfo proto.InternalMessageInfo + +func (m *WebNotificationsInfo) GetTimestamp() uint64 { + if m != nil && m.Timestamp != nil { + return *m.Timestamp + } + return 0 +} + +func (m *WebNotificationsInfo) GetUnreadChats() uint32 { + if m != nil && m.UnreadChats != nil { + return *m.UnreadChats + } + return 0 +} + +func (m *WebNotificationsInfo) GetNotifyMessageCount() uint32 { + if m != nil && m.NotifyMessageCount != nil { + return *m.NotifyMessageCount + } + return 0 +} + +func (m *WebNotificationsInfo) GetNotifyMessages() []*Message { + if m != nil { + return m.NotifyMessages + } + return nil +} + +type NotificationMessageInfo struct { + Key *MessageKey `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + Message *Message `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + MessageTimestamp *uint64 `protobuf:"varint,3,opt,name=messageTimestamp" json:"messageTimestamp,omitempty"` + Participant *string `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NotificationMessageInfo) Reset() { *m = NotificationMessageInfo{} } +func (m *NotificationMessageInfo) String() string { return proto.CompactTextString(m) } +func (*NotificationMessageInfo) ProtoMessage() {} +func (*NotificationMessageInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{32} +} +func (m *NotificationMessageInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NotificationMessageInfo.Unmarshal(m, b) +} +func (m *NotificationMessageInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NotificationMessageInfo.Marshal(b, m, deterministic) +} +func (dst *NotificationMessageInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_NotificationMessageInfo.Merge(dst, src) +} +func (m *NotificationMessageInfo) XXX_Size() int { + return xxx_messageInfo_NotificationMessageInfo.Size(m) +} +func (m *NotificationMessageInfo) XXX_DiscardUnknown() { + xxx_messageInfo_NotificationMessageInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_NotificationMessageInfo proto.InternalMessageInfo + +func (m *NotificationMessageInfo) GetKey() *MessageKey { + if m != nil { + return m.Key + } + return nil +} + +func (m *NotificationMessageInfo) GetMessage() *Message { + if m != nil { + return m.Message + } + return nil +} + +func (m *NotificationMessageInfo) GetMessageTimestamp() uint64 { + if m != nil && m.MessageTimestamp != nil { + return *m.MessageTimestamp + } + return 0 +} + +func (m *NotificationMessageInfo) GetParticipant() string { + if m != nil && m.Participant != nil { + return *m.Participant + } + return "" +} + +type TabletNotificationsInfo struct { + Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` + UnreadChats *uint32 `protobuf:"varint,3,opt,name=unreadChats" json:"unreadChats,omitempty"` + NotifyMessageCount *uint32 `protobuf:"varint,4,opt,name=notifyMessageCount" json:"notifyMessageCount,omitempty"` + NotifyMessage []*Message `protobuf:"bytes,5,rep,name=notifyMessage" json:"notifyMessage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TabletNotificationsInfo) Reset() { *m = TabletNotificationsInfo{} } +func (m *TabletNotificationsInfo) String() string { return proto.CompactTextString(m) } +func (*TabletNotificationsInfo) ProtoMessage() {} +func (*TabletNotificationsInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{33} +} +func (m *TabletNotificationsInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TabletNotificationsInfo.Unmarshal(m, b) +} +func (m *TabletNotificationsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TabletNotificationsInfo.Marshal(b, m, deterministic) +} +func (dst *TabletNotificationsInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TabletNotificationsInfo.Merge(dst, src) +} +func (m *TabletNotificationsInfo) XXX_Size() int { + return xxx_messageInfo_TabletNotificationsInfo.Size(m) +} +func (m *TabletNotificationsInfo) XXX_DiscardUnknown() { + xxx_messageInfo_TabletNotificationsInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_TabletNotificationsInfo proto.InternalMessageInfo + +func (m *TabletNotificationsInfo) GetTimestamp() uint64 { + if m != nil && m.Timestamp != nil { + return *m.Timestamp + } + return 0 +} + +func (m *TabletNotificationsInfo) GetUnreadChats() uint32 { + if m != nil && m.UnreadChats != nil { + return *m.UnreadChats + } + return 0 +} + +func (m *TabletNotificationsInfo) GetNotifyMessageCount() uint32 { + if m != nil && m.NotifyMessageCount != nil { + return *m.NotifyMessageCount + } + return 0 +} + +func (m *TabletNotificationsInfo) GetNotifyMessage() []*Message { + if m != nil { + return m.NotifyMessage + } + return nil +} + +type WebFeatures struct { + LabelsDisplay *WebFeatures_FLAG `protobuf:"varint,1,opt,name=labelsDisplay,enum=proto.WebFeatures_FLAG" json:"labelsDisplay,omitempty"` + VoipIndividualOutgoing *WebFeatures_FLAG `protobuf:"varint,2,opt,name=voipIndividualOutgoing,enum=proto.WebFeatures_FLAG" json:"voipIndividualOutgoing,omitempty"` + GroupsV3 *WebFeatures_FLAG `protobuf:"varint,3,opt,name=groupsV3,enum=proto.WebFeatures_FLAG" json:"groupsV3,omitempty"` + GroupsV3Create *WebFeatures_FLAG `protobuf:"varint,4,opt,name=groupsV3Create,enum=proto.WebFeatures_FLAG" json:"groupsV3Create,omitempty"` + ChangeNumberV2 *WebFeatures_FLAG `protobuf:"varint,5,opt,name=changeNumberV2,enum=proto.WebFeatures_FLAG" json:"changeNumberV2,omitempty"` + QueryStatusV3Thumbnail *WebFeatures_FLAG `protobuf:"varint,6,opt,name=queryStatusV3Thumbnail,enum=proto.WebFeatures_FLAG" json:"queryStatusV3Thumbnail,omitempty"` + LiveLocations *WebFeatures_FLAG `protobuf:"varint,7,opt,name=liveLocations,enum=proto.WebFeatures_FLAG" json:"liveLocations,omitempty"` + QueryVname *WebFeatures_FLAG `protobuf:"varint,8,opt,name=queryVname,enum=proto.WebFeatures_FLAG" json:"queryVname,omitempty"` + VoipIndividualIncoming *WebFeatures_FLAG `protobuf:"varint,9,opt,name=voipIndividualIncoming,enum=proto.WebFeatures_FLAG" json:"voipIndividualIncoming,omitempty"` + QuickRepliesQuery *WebFeatures_FLAG `protobuf:"varint,10,opt,name=quickRepliesQuery,enum=proto.WebFeatures_FLAG" json:"quickRepliesQuery,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WebFeatures) Reset() { *m = WebFeatures{} } +func (m *WebFeatures) String() string { return proto.CompactTextString(m) } +func (*WebFeatures) ProtoMessage() {} +func (*WebFeatures) Descriptor() ([]byte, []int) { + return fileDescriptor_def_131d1935231ace52, []int{34} +} +func (m *WebFeatures) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WebFeatures.Unmarshal(m, b) +} +func (m *WebFeatures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WebFeatures.Marshal(b, m, deterministic) +} +func (dst *WebFeatures) XXX_Merge(src proto.Message) { + xxx_messageInfo_WebFeatures.Merge(dst, src) +} +func (m *WebFeatures) XXX_Size() int { + return xxx_messageInfo_WebFeatures.Size(m) +} +func (m *WebFeatures) XXX_DiscardUnknown() { + xxx_messageInfo_WebFeatures.DiscardUnknown(m) +} + +var xxx_messageInfo_WebFeatures proto.InternalMessageInfo + +func (m *WebFeatures) GetLabelsDisplay() WebFeatures_FLAG { + if m != nil && m.LabelsDisplay != nil { + return *m.LabelsDisplay + } + return WebFeatures_NOT_IMPLEMENTED +} + +func (m *WebFeatures) GetVoipIndividualOutgoing() WebFeatures_FLAG { + if m != nil && m.VoipIndividualOutgoing != nil { + return *m.VoipIndividualOutgoing + } + return WebFeatures_NOT_IMPLEMENTED +} + +func (m *WebFeatures) GetGroupsV3() WebFeatures_FLAG { + if m != nil && m.GroupsV3 != nil { + return *m.GroupsV3 + } + return WebFeatures_NOT_IMPLEMENTED +} + +func (m *WebFeatures) GetGroupsV3Create() WebFeatures_FLAG { + if m != nil && m.GroupsV3Create != nil { + return *m.GroupsV3Create + } + return WebFeatures_NOT_IMPLEMENTED +} + +func (m *WebFeatures) GetChangeNumberV2() WebFeatures_FLAG { + if m != nil && m.ChangeNumberV2 != nil { + return *m.ChangeNumberV2 + } + return WebFeatures_NOT_IMPLEMENTED +} + +func (m *WebFeatures) GetQueryStatusV3Thumbnail() WebFeatures_FLAG { + if m != nil && m.QueryStatusV3Thumbnail != nil { + return *m.QueryStatusV3Thumbnail + } + return WebFeatures_NOT_IMPLEMENTED +} + +func (m *WebFeatures) GetLiveLocations() WebFeatures_FLAG { + if m != nil && m.LiveLocations != nil { + return *m.LiveLocations + } + return WebFeatures_NOT_IMPLEMENTED +} + +func (m *WebFeatures) GetQueryVname() WebFeatures_FLAG { + if m != nil && m.QueryVname != nil { + return *m.QueryVname + } + return WebFeatures_NOT_IMPLEMENTED +} + +func (m *WebFeatures) GetVoipIndividualIncoming() WebFeatures_FLAG { + if m != nil && m.VoipIndividualIncoming != nil { + return *m.VoipIndividualIncoming + } + return WebFeatures_NOT_IMPLEMENTED +} + +func (m *WebFeatures) GetQuickRepliesQuery() WebFeatures_FLAG { + if m != nil && m.QuickRepliesQuery != nil { + return *m.QuickRepliesQuery + } + return WebFeatures_NOT_IMPLEMENTED +} + +func init() { + proto.RegisterType((*FingerprintData)(nil), "proto.FingerprintData") + proto.RegisterType((*CombinedFingerprint)(nil), "proto.CombinedFingerprint") + proto.RegisterType((*MessageKey)(nil), "proto.MessageKey") + proto.RegisterType((*SenderKeyDistributionMessage)(nil), "proto.SenderKeyDistributionMessage") + proto.RegisterType((*ImageMessage)(nil), "proto.ImageMessage") + proto.RegisterType((*ContactMessage)(nil), "proto.ContactMessage") + proto.RegisterType((*LocationMessage)(nil), "proto.LocationMessage") + proto.RegisterType((*ExtendedTextMessage)(nil), "proto.ExtendedTextMessage") + proto.RegisterType((*DocumentMessage)(nil), "proto.DocumentMessage") + proto.RegisterType((*AudioMessage)(nil), "proto.AudioMessage") + proto.RegisterType((*VideoMessage)(nil), "proto.VideoMessage") + proto.RegisterType((*Call)(nil), "proto.Call") + proto.RegisterType((*Chat)(nil), "proto.Chat") + proto.RegisterType((*ProtocolMessage)(nil), "proto.ProtocolMessage") + proto.RegisterType((*ContactsArrayMessage)(nil), "proto.ContactsArrayMessage") + proto.RegisterType((*HSMCurrency)(nil), "proto.HSMCurrency") + proto.RegisterType((*HSMDateTimeComponent)(nil), "proto.HSMDateTimeComponent") + proto.RegisterType((*HSMDateTimeUnixEpoch)(nil), "proto.HSMDateTimeUnixEpoch") + proto.RegisterType((*HSMDateTime)(nil), "proto.HSMDateTime") + proto.RegisterType((*HSMLocalizableParameter)(nil), "proto.HSMLocalizableParameter") + proto.RegisterType((*HighlyStructuredMessage)(nil), "proto.HighlyStructuredMessage") + proto.RegisterType((*SendPaymentMessage)(nil), "proto.SendPaymentMessage") + proto.RegisterType((*RequestPaymentMessage)(nil), "proto.RequestPaymentMessage") + proto.RegisterType((*LiveLocationMessage)(nil), "proto.LiveLocationMessage") + proto.RegisterType((*StickerMessage)(nil), "proto.StickerMessage") + proto.RegisterType((*Message)(nil), "proto.Message") + proto.RegisterType((*ContextInfo)(nil), "proto.ContextInfo") + proto.RegisterType((*InteractiveAnnotation)(nil), "proto.InteractiveAnnotation") + proto.RegisterType((*Point)(nil), "proto.Point") + proto.RegisterType((*Location)(nil), "proto.Location") + proto.RegisterType((*WebMessageInfo)(nil), "proto.WebMessageInfo") + proto.RegisterType((*WebNotificationsInfo)(nil), "proto.WebNotificationsInfo") + proto.RegisterType((*NotificationMessageInfo)(nil), "proto.NotificationMessageInfo") + proto.RegisterType((*TabletNotificationsInfo)(nil), "proto.TabletNotificationsInfo") + proto.RegisterType((*WebFeatures)(nil), "proto.WebFeatures") + proto.RegisterEnum("proto.ExtendedTextMessage_FONTTYPE", ExtendedTextMessage_FONTTYPE_name, ExtendedTextMessage_FONTTYPE_value) + proto.RegisterEnum("proto.VideoMessage_ATTRIBUTION", VideoMessage_ATTRIBUTION_name, VideoMessage_ATTRIBUTION_value) + proto.RegisterEnum("proto.ProtocolMessage_TYPE", ProtocolMessage_TYPE_name, ProtocolMessage_TYPE_value) + proto.RegisterEnum("proto.HSMDateTimeComponent_DAYOFWEEKTYPE", HSMDateTimeComponent_DAYOFWEEKTYPE_name, HSMDateTimeComponent_DAYOFWEEKTYPE_value) + proto.RegisterEnum("proto.HSMDateTimeComponent_CALENDARTYPE", HSMDateTimeComponent_CALENDARTYPE_name, HSMDateTimeComponent_CALENDARTYPE_value) + proto.RegisterEnum("proto.WebMessageInfo_STATUS", WebMessageInfo_STATUS_name, WebMessageInfo_STATUS_value) + proto.RegisterEnum("proto.WebMessageInfo_STUBTYPE", WebMessageInfo_STUBTYPE_name, WebMessageInfo_STUBTYPE_value) + proto.RegisterEnum("proto.WebFeatures_FLAG", WebFeatures_FLAG_name, WebFeatures_FLAG_value) +} + +func init() { proto.RegisterFile("def.proto", fileDescriptor_def_131d1935231ace52) } + +var fileDescriptor_def_131d1935231ace52 = []byte{ + // 3724 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x3a, 0x4d, 0x6f, 0xe3, 0x48, + 0x76, 0xad, 0x0f, 0xdb, 0xd2, 0x93, 0x2c, 0xd1, 0x65, 0xbb, 0xad, 0xe9, 0xf6, 0xce, 0x78, 0xd9, + 0x9b, 0x59, 0xef, 0x04, 0xeb, 0xf4, 0x78, 0x3a, 0x33, 0xc1, 0x06, 0x83, 0x84, 0x96, 0x68, 0x9b, + 0xdd, 0x32, 0xa9, 0x2d, 0x51, 0xf6, 0xf8, 0x24, 0x94, 0xc9, 0xb2, 0xc4, 0x34, 0x45, 0x6a, 0xc8, + 0x92, 0xa7, 0xb5, 0x01, 0x72, 0xd9, 0x4b, 0x10, 0x20, 0xf7, 0x5c, 0x83, 0x20, 0xd7, 0x5c, 0x02, + 0x04, 0x9b, 0x00, 0x49, 0x7e, 0x42, 0xfe, 0x46, 0x0e, 0xb9, 0xe4, 0x96, 0x4b, 0x90, 0xa0, 0x8a, + 0xa4, 0x44, 0x4a, 0xb2, 0xbb, 0xa7, 0x93, 0xe9, 0xe4, 0x64, 0xd5, 0xfb, 0xaa, 0x57, 0xef, 0xd5, + 0x7b, 0xf5, 0xde, 0xa3, 0xa1, 0x6c, 0xd3, 0xdb, 0xa3, 0x71, 0xe0, 0x33, 0x1f, 0xad, 0x89, 0x3f, + 0xb2, 0x01, 0xf5, 0x53, 0xc7, 0x1b, 0xd0, 0x60, 0x1c, 0x38, 0x1e, 0x6b, 0x11, 0x46, 0xd0, 0x3e, + 0x94, 0xc7, 0x93, 0x1b, 0xd7, 0xb1, 0x5e, 0xd1, 0x69, 0x23, 0x77, 0x90, 0x3b, 0x2c, 0xe3, 0x39, + 0x00, 0x7d, 0x0c, 0xe0, 0xd8, 0xd4, 0x63, 0xce, 0xad, 0x43, 0x83, 0x46, 0x5e, 0xa0, 0x53, 0x10, + 0xf9, 0xef, 0x73, 0xb0, 0xdd, 0xf4, 0x47, 0x37, 0x8e, 0x47, 0xed, 0x94, 0x64, 0xd4, 0x80, 0x8d, + 0x3b, 0x1a, 0x84, 0x8e, 0xef, 0x09, 0x99, 0x9b, 0x38, 0x59, 0xa2, 0x13, 0x90, 0x5c, 0xdf, 0x22, + 0x6e, 0x8a, 0x5a, 0xc8, 0xad, 0x1c, 0x3f, 0x8e, 0x74, 0x3d, 0x5a, 0xd0, 0x10, 0x2f, 0xd1, 0xa3, + 0x16, 0x6c, 0x05, 0x74, 0xe4, 0x33, 0x9a, 0x16, 0x52, 0x78, 0x50, 0xc8, 0x32, 0x83, 0xcc, 0x00, + 0x2e, 0x68, 0x18, 0x92, 0x01, 0xe5, 0x27, 0xdd, 0x87, 0x72, 0x44, 0xf2, 0xd2, 0xb1, 0x13, 0x3b, + 0xcc, 0x00, 0xe8, 0x31, 0xac, 0xdf, 0x06, 0xfe, 0xe8, 0x82, 0x0a, 0x5d, 0x4b, 0x38, 0x5e, 0xa1, + 0x1a, 0xe4, 0x1d, 0x5b, 0x6c, 0x5d, 0xc6, 0x79, 0xc7, 0x46, 0x07, 0x50, 0x19, 0x93, 0x80, 0x39, + 0x96, 0x33, 0x26, 0x1e, 0x6b, 0x14, 0x05, 0x22, 0x0d, 0x92, 0xff, 0x2c, 0x07, 0xfb, 0x5d, 0xea, + 0xd9, 0x34, 0x78, 0x45, 0xa7, 0x2d, 0x27, 0x64, 0x81, 0x73, 0x33, 0x61, 0x8e, 0xef, 0xc5, 0xba, + 0x70, 0xd3, 0x0d, 0x02, 0x7f, 0x32, 0xd6, 0x12, 0x35, 0x92, 0x25, 0xea, 0xc0, 0x33, 0xf2, 0xc6, + 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x1f, 0x2b, 0x98, 0x67, 0xaa, 0x71, 0xe6, 0x19, 0xfd, 0x49, + 0x1d, 0x36, 0x6d, 0xc2, 0x28, 0x57, 0xcd, 0xf0, 0xa8, 0x7f, 0x2b, 0xff, 0x75, 0x0e, 0xf6, 0xce, + 0xbb, 0x17, 0xbc, 0x33, 0x72, 0x9d, 0x5f, 0x91, 0x1b, 0x97, 0x76, 0x48, 0x40, 0x46, 0x94, 0xd1, + 0x80, 0xe7, 0x1b, 0x9b, 0xde, 0x92, 0x89, 0x9b, 0xf4, 0x05, 0xc9, 0x12, 0x3d, 0x87, 0x52, 0x72, + 0xe3, 0x63, 0x15, 0xd0, 0x5c, 0x85, 0x24, 0x56, 0xce, 0x1f, 0xe1, 0x19, 0x15, 0xe7, 0xb0, 0x63, + 0xd5, 0xe2, 0x79, 0x0b, 0x5a, 0x56, 0x9a, 0x73, 0x24, 0x54, 0x27, 0x55, 0x80, 0x31, 0x57, 0x25, + 0xd2, 0xf3, 0xbf, 0xb8, 0x9e, 0xce, 0x60, 0xe8, 0x4e, 0xbb, 0x2c, 0x98, 0x58, 0x6c, 0x12, 0x50, + 0x3b, 0xc9, 0x16, 0xfb, 0x50, 0xe6, 0x4d, 0x56, 0x38, 0x26, 0x56, 0x12, 0x90, 0x73, 0x00, 0xcf, + 0x25, 0xd4, 0xa5, 0xbc, 0xea, 0x15, 0xb9, 0x24, 0x6e, 0x63, 0x52, 0x20, 0x7e, 0x9f, 0xc5, 0x4e, + 0x61, 0xa3, 0x70, 0x50, 0x38, 0x2c, 0xe3, 0x78, 0x25, 0xde, 0x74, 0xe2, 0xba, 0xfc, 0x35, 0x6d, + 0x0f, 0xe2, 0xe6, 0x26, 0x05, 0xc9, 0xe0, 0xad, 0xb8, 0xb3, 0x49, 0x41, 0x50, 0x1b, 0xb6, 0xdc, + 0x05, 0xbb, 0x86, 0x8d, 0x75, 0x91, 0xac, 0x3e, 0x9e, 0x1f, 0x7e, 0x95, 0xe9, 0xf1, 0x32, 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09, 0xbf, 0xa4, 0x3a, + 0xd6, 0x30, 0xfe, 0x1a, 0xf6, 0x80, 0x5f, 0xd2, 0xd4, 0xe8, 0x2b, 0x00, 0x21, 0xf8, 0xd2, 0x4b, + 0xfe, 0xb3, 0xe5, 0x01, 0xde, 0x14, 0xe9, 0xb2, 0x43, 0x35, 0xcf, 0xf2, 0x47, 0xdc, 0xa1, 0xe5, + 0xef, 0xe5, 0xd0, 0x84, 0x0d, 0xa9, 0xb0, 0xf5, 0xed, 0xc4, 0xb1, 0x5e, 0x63, 0x3a, 0x76, 0x1d, + 0x1a, 0xfe, 0x92, 0x6f, 0x25, 0x46, 0x42, 0x0f, 0xc8, 0x5a, 0xe6, 0x90, 0x7f, 0x01, 0x45, 0x8e, + 0x8a, 0xfe, 0xa7, 0xc9, 0xec, 0x6b, 0x17, 0x9d, 0xb6, 0x7a, 0xa1, 0xea, 0x3c, 0xdd, 0x3e, 0xe2, + 0x75, 0x59, 0x1a, 0x90, 0x43, 0x55, 0x28, 0x19, 0xe2, 0x75, 0x54, 0xda, 0x52, 0xfe, 0xbf, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x11, 0x17, 0x9b, 0xf6, 0x8b, 0x2c, 0x00, 0x00, +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/binary/proto/def.proto b/vendor/github.com/Rhymen/go-whatsapp/binary/proto/def.proto new file mode 100644 index 00000000..a885973d --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/binary/proto/def.proto @@ -0,0 +1,417 @@ +syntax = "proto2"; +package proto; + +message FingerprintData { + optional string publicKey = 1; + optional string identifier = 2; +} + +message CombinedFingerprint { + optional uint32 version = 1; + optional FingerprintData localFingerprint = 2; + optional FingerprintData remoteFingerprint = 3; +} + +message MessageKey { + optional string remoteJid = 1; + optional bool fromMe = 2; + optional string id = 3; + optional string participant = 4; +} + +message SenderKeyDistributionMessage { + optional string groupId = 1; + optional bytes axolotlSenderKeyDistributionMessage = 2; +} + +message ImageMessage { + optional string url = 1; + optional string mimetype = 2; + optional string caption = 3; + optional bytes fileSha256 = 4; + optional uint64 fileLength = 5; + optional uint32 height = 6; + optional uint32 width = 7; + optional bytes mediaKey = 8; + optional bytes fileEncSha256 = 9; + repeated InteractiveAnnotation interactiveAnnotations = 10; + optional string directPath = 11; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; + optional bytes firstScanSidecar = 18; + optional uint32 firstScanLength = 19; +} + +message ContactMessage { + optional string displayName = 1; + optional string vcard = 16; + optional ContextInfo contextInfo = 17; +} + +message LocationMessage { + optional double degreesLatitude = 1; + optional double degreesLongitude = 2; + optional string name = 3; + optional string address = 4; + optional string url = 5; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; +} + +message ExtendedTextMessage { + optional string text = 1; + optional string matchedText = 2; + optional string canonicalUrl = 4; + optional string description = 5; + optional string title = 6; + optional fixed32 textArgb = 7; + optional fixed32 backgroundArgb = 8; + enum FONTTYPE { + SANS_SERIF = 0; + SERIF = 1; + NORICAN_REGULAR = 2; + BRYNDAN_WRITE = 3; + BEBASNEUE_REGULAR = 4; + OSWALD_HEAVY = 5; + } + optional FONTTYPE font = 9; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; +} + +message DocumentMessage { + optional string url = 1; + optional string mimetype = 2; + optional string title = 3; + optional bytes fileSha256 = 4; + optional uint64 fileLength = 5; + optional uint32 pageCount = 6; + optional bytes mediaKey = 7; + optional string fileName = 8; + optional bytes fileEncSha256 = 9; + optional string directPath = 10; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; +} + +message AudioMessage { + optional string url = 1; + optional string mimetype = 2; + optional bytes fileSha256 = 3; + optional uint64 fileLength = 4; + optional uint32 seconds = 5; + optional bool ptt = 6; + optional bytes mediaKey = 7; + optional bytes fileEncSha256 = 8; + optional string directPath = 9; + optional ContextInfo contextInfo = 17; + optional bytes streamingSidecar = 18; +} + +message VideoMessage { + optional string url = 1; + optional string mimetype = 2; + optional bytes fileSha256 = 3; + optional uint64 fileLength = 4; + optional uint32 seconds = 5; + optional bytes mediaKey = 6; + optional string caption = 7; + optional bool gifPlayback = 8; + optional uint32 height = 9; + optional uint32 width = 10; + optional bytes fileEncSha256 = 11; + repeated InteractiveAnnotation interactiveAnnotations = 12; + optional string directPath = 13; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; + optional bytes streamingSidecar = 18; + enum ATTRIBUTION { + NONE = 0; + GIPHY = 1; + TENOR = 2; + } + optional ATTRIBUTION gifAttribution = 19; +} + +message Call { + optional bytes callKey = 1; +} + +message Chat { + optional string displayName = 1; + optional string id = 2; +} + +message ProtocolMessage { + optional MessageKey key = 1; + enum TYPE { + REVOKE = 0; + } + optional TYPE type = 2; +} + +message ContactsArrayMessage { + optional string displayName = 1; + repeated ContactMessage contacts = 2; + optional ContextInfo contextInfo = 17; +} + +message HSMCurrency { + optional string currencyCode = 1; + optional int64 amount1000 = 2; +} + +message HSMDateTimeComponent { + enum DAYOFWEEKTYPE { + MONDAY = 1; + TUESDAY = 2; + WEDNESDAY = 3; + THURSDAY = 4; + FRIDAY = 5; + SATURDAY = 6; + SUNDAY = 7; + } + optional DAYOFWEEKTYPE dayOfWeek = 1; + optional uint32 year = 2; + optional uint32 month = 3; + optional uint32 dayOfMonth = 4; + optional uint32 hour = 5; + optional uint32 minute = 6; + enum CALENDARTYPE { + GREGORIAN = 1; + SOLAR_HIJRI = 2; + } + optional CALENDARTYPE calendar = 7; +} + +message HSMDateTimeUnixEpoch { + optional int64 timestamp = 1; +} + +message HSMDateTime { + oneof datetimeOneof { + HSMDateTimeComponent component = 1; + HSMDateTimeUnixEpoch unixEpoch = 2; + } +} + +message HSMLocalizableParameter { + optional string default = 1; + oneof paramOneof { + HSMCurrency currency = 2; + HSMDateTime dateTime = 3; + } +} + +message HighlyStructuredMessage { + optional string namespace = 1; + optional string elementName = 2; + repeated string params = 3; + optional string fallbackLg = 4; + optional string fallbackLc = 5; + repeated HSMLocalizableParameter localizableParams = 6; +} + +message SendPaymentMessage { + optional Message noteMessage = 2; +} + +message RequestPaymentMessage { + optional string currencyCodeIso4217 = 1; + optional uint64 amount1000 = 2; + optional string requestFrom = 3; + optional Message noteMessage = 4; +} + +message LiveLocationMessage { + optional double degreesLatitude = 1; + optional double degreesLongitude = 2; + optional uint32 accuracyInMeters = 3; + optional float speedInMps = 4; + optional uint32 degreesClockwiseFromMagneticNorth = 5; + optional string caption = 6; + optional int64 sequenceNumber = 7; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; +} + +message StickerMessage { + optional string url = 1; + optional bytes fileSha256 = 2; + optional bytes fileEncSha256 = 3; + optional bytes mediaKey = 4; + optional string mimetype = 5; + optional uint32 height = 6; + optional uint32 width = 7; + optional string directPath = 8; + optional uint64 fileLength = 9; + optional bytes pngThumbnail = 16; + optional ContextInfo contextInfo = 17; +} + +message Message { + optional string conversation = 1; + optional SenderKeyDistributionMessage senderKeyDistributionMessage = 2; + optional ImageMessage imageMessage = 3; + optional ContactMessage contactMessage = 4; + optional LocationMessage locationMessage = 5; + optional ExtendedTextMessage extendedTextMessage = 6; + optional DocumentMessage documentMessage = 7; + optional AudioMessage audioMessage = 8; + optional VideoMessage videoMessage = 9; + optional Call call = 10; + optional Chat chat = 11; + optional ProtocolMessage protocolMessage = 12; + optional ContactsArrayMessage contactsArrayMessage = 13; + optional HighlyStructuredMessage highlyStructuredMessage = 14; + optional SenderKeyDistributionMessage fastRatchetKeySenderKeyDistributionMessage = 15; + optional SendPaymentMessage sendPaymentMessage = 16; + optional RequestPaymentMessage requestPaymentMessage = 17; + optional LiveLocationMessage liveLocationMessage = 18; + optional StickerMessage stickerMessage = 20; +} + +message ContextInfo { + optional string stanzaId = 1; + optional string participant = 2; + repeated Message quotedMessage = 3; + optional string remoteJid = 4; + repeated string mentionedJid = 15; + optional string conversionSource = 18; + optional bytes conversionData = 19; + optional uint32 conversionDelaySeconds = 20; + optional bool isForwarded = 22; + reserved 16, 17; +} + +message InteractiveAnnotation { + repeated Point polygonVertices = 1; + oneof action { + Location location = 2; + } +} + +message Point { + optional double x = 3; + optional double y = 4; +} + +message Location { + optional double degreesLatitude = 1; + optional double degreesLongitude = 2; + optional string name = 3; +} + +message WebMessageInfo { + required MessageKey key = 1; + optional Message message = 2; + optional uint64 messageTimestamp = 3; + enum STATUS { + ERROR = 0; + PENDING = 1; + SERVER_ACK = 2; + DELIVERY_ACK = 3; + READ = 4; + PLAYED = 5; + } + optional STATUS status = 4 [default=PENDING]; + optional string participant = 5; + optional bool ignore = 16; + optional bool starred = 17; + optional bool broadcast = 18; + optional string pushName = 19; + optional bytes mediaCiphertextSha256 = 20; + optional bool multicast = 21; + optional bool urlText = 22; + optional bool urlNumber = 23; + enum STUBTYPE { + UNKNOWN = 0; + REVOKE = 1; + CIPHERTEXT = 2; + FUTUREPROOF = 3; + NON_VERIFIED_TRANSITION = 4; + UNVERIFIED_TRANSITION = 5; + VERIFIED_TRANSITION = 6; + VERIFIED_LOW_UNKNOWN = 7; + VERIFIED_HIGH = 8; + VERIFIED_INITIAL_UNKNOWN = 9; + VERIFIED_INITIAL_LOW = 10; + VERIFIED_INITIAL_HIGH = 11; + VERIFIED_TRANSITION_ANY_TO_NONE = 12; + VERIFIED_TRANSITION_ANY_TO_HIGH = 13; + VERIFIED_TRANSITION_HIGH_TO_LOW = 14; + VERIFIED_TRANSITION_HIGH_TO_UNKNOWN = 15; + VERIFIED_TRANSITION_UNKNOWN_TO_LOW = 16; + VERIFIED_TRANSITION_LOW_TO_UNKNOWN = 17; + VERIFIED_TRANSITION_NONE_TO_LOW = 18; + VERIFIED_TRANSITION_NONE_TO_UNKNOWN = 19; + GROUP_CREATE = 20; + GROUP_CHANGE_SUBJECT = 21; + GROUP_CHANGE_ICON = 22; + GROUP_CHANGE_INVITE_LINK = 23; + GROUP_CHANGE_DESCRIPTION = 24; + GROUP_CHANGE_RESTRICT = 25; + GROUP_CHANGE_ANNOUNCE = 26; + GROUP_PARTICIPANT_ADD = 27; + GROUP_PARTICIPANT_REMOVE = 28; + GROUP_PARTICIPANT_PROMOTE = 29; + GROUP_PARTICIPANT_DEMOTE = 30; + GROUP_PARTICIPANT_INVITE = 31; + GROUP_PARTICIPANT_LEAVE = 32; + GROUP_PARTICIPANT_CHANGE_NUMBER = 33; + BROADCAST_CREATE = 34; + BROADCAST_ADD = 35; + BROADCAST_REMOVE = 36; + GENERIC_NOTIFICATION = 37; + E2E_IDENTITY_CHANGED = 38; + E2E_ENCRYPTED = 39; + CALL_MISSED_VOICE = 40; + CALL_MISSED_VIDEO = 41; + INDIVIDUAL_CHANGE_NUMBER = 42; + GROUP_DELETE = 43; + } + optional STUBTYPE messageStubType = 24; + optional bool clearMedia = 25; + repeated string messageStubParameters = 26; + optional uint32 duration = 27; + repeated string labels = 28; +} + +message WebNotificationsInfo { + optional uint64 timestamp = 2; + optional uint32 unreadChats = 3; + optional uint32 notifyMessageCount = 4; + repeated Message notifyMessages = 5; +} + +message NotificationMessageInfo { + optional MessageKey key = 1; + optional Message message = 2; + optional uint64 messageTimestamp = 3; + optional string participant = 4; +} + +message TabletNotificationsInfo { + optional uint64 timestamp = 2; + optional uint32 unreadChats = 3; + optional uint32 notifyMessageCount = 4; + repeated Message notifyMessage = 5; +} + +message WebFeatures { + enum FLAG { + NOT_IMPLEMENTED = 0; + IMPLEMENTED = 1; + OPTIONAL = 2; + } + optional FLAG labelsDisplay = 1; + optional FLAG voipIndividualOutgoing = 2; + optional FLAG groupsV3 = 3; + optional FLAG groupsV3Create = 4; + optional FLAG changeNumberV2 = 5; + optional FLAG queryStatusV3Thumbnail = 6; + optional FLAG liveLocations = 7; + optional FLAG queryVname = 8; + optional FLAG voipIndividualIncoming = 9; + optional FLAG quickRepliesQuery = 10; +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/binary/token/token.go b/vendor/github.com/Rhymen/go-whatsapp/binary/token/token.go new file mode 100644 index 00000000..070a6896 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/binary/token/token.go @@ -0,0 +1,78 @@ +package token + +import "fmt" + +var SingleByteTokens = [...]string{"", "", "", "200", "400", "404", "500", "501", "502", "action", "add", + "after", "archive", "author", "available", "battery", "before", "body", + "broadcast", "chat", "clear", "code", "composing", "contacts", "count", + "create", "debug", "delete", "demote", "duplicate", "encoding", "error", + "false", "filehash", "from", "g.us", "group", "groups_v2", "height", "id", + "image", "in", "index", "invis", "item", "jid", "kind", "last", "leave", + "live", "log", "media", "message", "mimetype", "missing", "modify", "name", + "notification", "notify", "out", "owner", "participant", "paused", + "picture", "played", "presence", "preview", "promote", "query", "raw", + "read", "receipt", "received", "recipient", "recording", "relay", + "remove", "response", "resume", "retry", "s.whatsapp.net", "seconds", + "set", "size", "status", "subject", "subscribe", "t", "text", "to", "true", + "type", "unarchive", "unavailable", "url", "user", "value", "web", "width", + "mute", "read_only", "admin", "creator", "short", "update", "powersave", + "checksum", "epoch", "block", "previous", "409", "replaced", "reason", + "spam", "modify_tag", "message_info", "delivery", "emoji", "title", + "description", "canonical-url", "matched-text", "star", "unstar", + "media_key", "filename", "identity", "unread", "page", "page_count", + "search", "media_message", "security", "call_log", "profile", "ciphertext", + "invite", "gif", "vcard", "frequent", "privacy", "blacklist", "whitelist", + "verify", "location", "document", "elapsed", "revoke_invite", "expiration", + "unsubscribe", "disable", "vname", "old_jid", "new_jid", "announcement", + "locked", "prop", "label", "color", "call", "offer", "call-id"} + +var doubleByteTokens = [...]string{} + +func GetSingleToken(i int) (string, error) { + if i < 3 || i >= len(SingleByteTokens) { + return "", fmt.Errorf("index out of single byte token bounds %d", i) + } + + return SingleByteTokens[i], nil +} + +func GetDoubleToken(index1 int, index2 int) (string, error) { + n := 256*index1 + index2 + if n < 0 || n >= len(doubleByteTokens) { + return "", fmt.Errorf("index out of double byte token bounds %d", n) + } + + return doubleByteTokens[n], nil +} + +func IndexOfSingleToken(token string) int { + for i, t := range SingleByteTokens { + if t == token { + return i + } + } + + return -1 +} + +const ( + LIST_EMPTY = 0 + STREAM_END = 2 + DICTIONARY_0 = 236 + DICTIONARY_1 = 237 + DICTIONARY_2 = 238 + DICTIONARY_3 = 239 + LIST_8 = 248 + LIST_16 = 249 + JID_PAIR = 250 + HEX_8 = 251 + BINARY_8 = 252 + BINARY_20 = 253 + BINARY_32 = 254 + NIBBLE_8 = 255 +) + +const ( + PACKED_MAX = 254 + SINGLE_BYTE_MAX = 256 +) diff --git a/vendor/github.com/Rhymen/go-whatsapp/conn.go b/vendor/github.com/Rhymen/go-whatsapp/conn.go new file mode 100644 index 00000000..ff83d42d --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/conn.go @@ -0,0 +1,210 @@ +//Package whatsapp provides a developer API to interact with the WhatsAppWeb-Servers. +package whatsapp + +import ( + "math/rand" + "net/http" + "sync" + "time" + + "github.com/gorilla/websocket" + "github.com/pkg/errors" +) + +type metric byte + +const ( + debugLog metric = iota + 1 + queryResume + queryReceipt + queryMedia + queryChat + queryContacts + queryMessages + presence + presenceSubscribe + group + read + chat + received + pic + status + message + queryActions + block + queryGroup + queryPreview + queryEmoji + queryMessageInfo + spam + querySearch + queryIdentity + queryUrl + profile + contact + queryVcard + queryStatus + queryStatusUpdate + privacyStatus + queryLiveLocations + liveLocation + queryVname + queryLabels + call + queryCall + queryQuickReplies +) + +type flag byte + +const ( + ignore flag = 1 << (7 - iota) + ackRequest + available + notAvailable + expires + skipOffline +) + +/* +Conn is created by NewConn. Interacting with the initialized Conn is the main way of interacting with our package. +It holds all necessary information to make the package work internally. +*/ +type Conn struct { + ws *websocketWrapper + listener *listenerWrapper + + connected bool + loggedIn bool + wg *sync.WaitGroup + + session *Session + sessionLock uint32 + handler []Handler + msgCount int + msgTimeout time.Duration + Info *Info + Store *Store + ServerLastSeen time.Time + + longClientName string + shortClientName string +} + +type websocketWrapper struct { + sync.Mutex + conn *websocket.Conn + close chan struct{} +} + +type listenerWrapper struct { + sync.RWMutex + m map[string]chan string +} + +/* +Creates a new connection with a given timeout. The websocket connection to the WhatsAppWeb servers get´s established. +The goroutine for handling incoming messages is started +*/ +func NewConn(timeout time.Duration) (*Conn, error) { + wac := &Conn{ + handler: make([]Handler, 0), + msgCount: 0, + msgTimeout: timeout, + Store: newStore(), + + longClientName: "github.com/rhymen/go-whatsapp", + shortClientName: "go-whatsapp", + } + return wac, wac.connect() +} + +// connect should be guarded with wsWriteMutex +func (wac *Conn) connect() (err error) { + if wac.connected { + return ErrAlreadyConnected + } + wac.connected = true + defer func() { // set connected to false on error + if err != nil { + wac.connected = false + } + }() + + dialer := &websocket.Dialer{ + ReadBufferSize: 25 * 1024 * 1024, + WriteBufferSize: 10 * 1024 * 1024, + HandshakeTimeout: wac.msgTimeout, + } + + headers := http.Header{"Origin": []string{"https://web.whatsapp.com"}} + wsConn, _, err := dialer.Dial("wss://web.whatsapp.com/ws", headers) + if err != nil { + return errors.Wrap(err, "couldn't dial whatsapp web websocket") + } + + wsConn.SetCloseHandler(func(code int, text string) error { + // from default CloseHandler + message := websocket.FormatCloseMessage(code, "") + err := wsConn.WriteControl(websocket.CloseMessage, message, time.Now().Add(time.Second)) + + // our close handling + _, _ = wac.Disconnect() + wac.handle(&ErrConnectionClosed{Code: code, Text: text}) + return err + }) + + wac.ws = &websocketWrapper{ + conn: wsConn, + close: make(chan struct{}), + } + + wac.listener = &listenerWrapper{ + m: make(map[string]chan string), + } + + wac.wg = &sync.WaitGroup{} + wac.wg.Add(2) + go wac.readPump() + go wac.keepAlive(20000, 60000) + + wac.loggedIn = false + return nil +} + +func (wac *Conn) Disconnect() (Session, error) { + if !wac.connected { + return Session{}, ErrNotConnected + } + wac.connected = false + wac.loggedIn = false + + close(wac.ws.close) //signal close + wac.wg.Wait() //wait for close + + err := wac.ws.conn.Close() + wac.ws = nil + + if wac.session == nil { + return Session{}, err + } + return *wac.session, err +} + +func (wac *Conn) keepAlive(minIntervalMs int, maxIntervalMs int) { + defer wac.wg.Done() + + for { + err := wac.sendKeepAlive() + if err != nil { + wac.handle(errors.Wrap(err, "keepAlive failed")) + //TODO: Consequences? + } + interval := rand.Intn(maxIntervalMs-minIntervalMs) + minIntervalMs + select { + case <-time.After(time.Duration(interval) * time.Millisecond): + case <-wac.ws.close: + return + } + } +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/contact.go b/vendor/github.com/Rhymen/go-whatsapp/contact.go new file mode 100644 index 00000000..9faaf5cc --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/contact.go @@ -0,0 +1,234 @@ +package whatsapp + +import ( + "fmt" + "github.com/Rhymen/go-whatsapp/binary" + "strconv" + "time" +) + +type Presence string + +const ( + PresenceAvailable = "available" + PresenceUnavailable = "unavailable" + PresenceComposing = "composing" + PresenceRecording = "recording" + PresencePaused = "paused" +) + +//TODO: filename? WhatsApp uses Store.Contacts for these functions +// functions probably shouldn't return a string, maybe build a struct / return json +// check for further queries +func (wac *Conn) GetProfilePicThumb(jid string) (<-chan string, error) { + data := []interface{}{"query", "ProfilePicThumb", jid} + return wac.writeJson(data) +} + +func (wac *Conn) GetStatus(jid string) (<-chan string, error) { + data := []interface{}{"query", "Status", jid} + return wac.writeJson(data) +} + +func (wac *Conn) SubscribePresence(jid string) (<-chan string, error) { + data := []interface{}{"action", "presence", "subscribe", jid} + return wac.writeJson(data) +} + +func (wac *Conn) Search(search string, count, page int) (*binary.Node, error) { + return wac.query("search", "", "", "", "", search, count, page) +} + +func (wac *Conn) LoadMessages(jid, messageId string, count int) (*binary.Node, error) { + return wac.query("message", jid, "", "before", "true", "", count, 0) +} + +func (wac *Conn) LoadMessagesBefore(jid, messageId string, count int) (*binary.Node, error) { + return wac.query("message", jid, messageId, "before", "true", "", count, 0) +} + +func (wac *Conn) LoadMessagesAfter(jid, messageId string, count int) (*binary.Node, error) { + return wac.query("message", jid, messageId, "after", "true", "", count, 0) +} + +func (wac *Conn) Presence(jid string, presence Presence) (<-chan string, error) { + ts := time.Now().Unix() + tag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) + + content := binary.Node{ + Description: "presence", + Attributes: map[string]string{ + "type": string(presence), + }, + } + switch presence { + case PresenceComposing: + fallthrough + case PresenceRecording: + fallthrough + case PresencePaused: + content.Attributes["to"] = jid + } + + n := binary.Node{ + Description: "action", + Attributes: map[string]string{ + "type": "set", + "epoch": strconv.Itoa(wac.msgCount), + }, + Content: []interface{}{content}, + } + + return wac.writeBinary(n, group, ignore, tag) +} + +func (wac *Conn) Exist(jid string) (<-chan string, error) { + data := []interface{}{"query", "exist", jid} + return wac.writeJson(data) +} + +func (wac *Conn) Emoji() (*binary.Node, error) { + return wac.query("emoji", "", "", "", "", "", 0, 0) +} + +func (wac *Conn) Contacts() (*binary.Node, error) { + return wac.query("contacts", "", "", "", "", "", 0, 0) +} + +func (wac *Conn) Chats() (*binary.Node, error) { + return wac.query("chat", "", "", "", "", "", 0, 0) +} + +func (wac *Conn) Read(jid, id string) (<-chan string, error) { + ts := time.Now().Unix() + tag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) + + n := binary.Node{ + Description: "action", + Attributes: map[string]string{ + "type": "set", + "epoch": strconv.Itoa(wac.msgCount), + }, + Content: []interface{}{binary.Node{ + Description: "read", + Attributes: map[string]string{ + "count": "1", + "index": id, + "jid": jid, + "owner": "false", + }, + }}, + } + + return wac.writeBinary(n, group, ignore, tag) +} + +func (wac *Conn) query(t, jid, messageId, kind, owner, search string, count, page int) (*binary.Node, error) { + ts := time.Now().Unix() + tag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) + + n := binary.Node{ + Description: "query", + Attributes: map[string]string{ + "type": t, + "epoch": strconv.Itoa(wac.msgCount), + }, + } + + if jid != "" { + n.Attributes["jid"] = jid + } + + if messageId != "" { + n.Attributes["index"] = messageId + } + + if kind != "" { + n.Attributes["kind"] = kind + } + + if owner != "" { + n.Attributes["owner"] = owner + } + + if search != "" { + n.Attributes["search"] = search + } + + if count != 0 { + n.Attributes["count"] = strconv.Itoa(count) + } + + if page != 0 { + n.Attributes["page"] = strconv.Itoa(page) + } + + ch, err := wac.writeBinary(n, group, ignore, tag) + if err != nil { + return nil, err + } + + msg, err := wac.decryptBinaryMessage([]byte(<-ch)) + if err != nil { + return nil, err + } + + //TODO: use parseProtoMessage + return msg, nil +} + +func (wac *Conn) setGroup(t, jid, subject string, participants []string) (<-chan string, error) { + ts := time.Now().Unix() + tag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) + + //TODO: get proto or improve encoder to handle []interface{} + + p := buildParticipantNodes(participants) + + g := binary.Node{ + Description: "group", + Attributes: map[string]string{ + "author": wac.session.Wid, + "id": tag, + "type": t, + }, + Content: p, + } + + if jid != "" { + g.Attributes["jid"] = jid + } + + if subject != "" { + g.Attributes["subject"] = subject + } + + n := binary.Node{ + Description: "action", + Attributes: map[string]string{ + "type": "set", + "epoch": strconv.Itoa(wac.msgCount), + }, + Content: []interface{}{g}, + } + + return wac.writeBinary(n, group, ignore, tag) +} + +func buildParticipantNodes(participants []string) []binary.Node { + l := len(participants) + if participants == nil || l == 0 { + return nil + } + + p := make([]binary.Node, len(participants)) + for i, participant := range participants { + p[i] = binary.Node{ + Description: "participant", + Attributes: map[string]string{ + "jid": participant, + }, + } + } + return p +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/crypto/cbc/cbc.go b/vendor/github.com/Rhymen/go-whatsapp/crypto/cbc/cbc.go new file mode 100644 index 00000000..cc5427c3 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/crypto/cbc/cbc.go @@ -0,0 +1,101 @@ +/* +CBC describes a block cipher mode. In cryptography, a block cipher mode of operation is an algorithm that uses a +block cipher to provide an information service such as confidentiality or authenticity. A block cipher by itself +is only suitable for the secure cryptographic transformation (encryption or decryption) of one fixed-length group of +bits called a block. A mode of operation describes how to repeatedly apply a cipher's single-block operation to +securely transform amounts of data larger than a block. + +This package simplifies the usage of AES-256-CBC. +*/ +package cbc + +/* +Some code is provided by the GitHub user locked (github.com/locked): +https://gist.github.com/locked/b066aa1ddeb2b28e855e +Thanks! +*/ +import ( + "bytes" + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "fmt" + "io" +) + +/* +Decrypt is a function that decrypts a given cipher text with a provided key and initialization vector(iv). +*/ +func Decrypt(key, iv, ciphertext []byte) ([]byte, error) { + block, err := aes.NewCipher(key) + + if err != nil { + return nil, err + } + + if len(ciphertext) < aes.BlockSize { + return nil, fmt.Errorf("ciphertext is shorter then block size: %d / %d", len(ciphertext), aes.BlockSize) + } + + if iv == nil { + iv = ciphertext[:aes.BlockSize] + ciphertext = ciphertext[aes.BlockSize:] + } + + cbc := cipher.NewCBCDecrypter(block, iv) + cbc.CryptBlocks(ciphertext, ciphertext) + + return unpad(ciphertext) +} + +/* +Encrypt is a function that encrypts plaintext with a given key and an optional initialization vector(iv). +*/ +func Encrypt(key, iv, plaintext []byte) ([]byte, error) { + plaintext = pad(plaintext, aes.BlockSize) + + if len(plaintext)%aes.BlockSize != 0 { + return nil, fmt.Errorf("plaintext is not a multiple of the block size: %d / %d", len(plaintext), aes.BlockSize) + } + + block, err := aes.NewCipher(key) + if err != nil { + return nil, err + } + + var ciphertext []byte + if iv == nil { + ciphertext = make([]byte, aes.BlockSize+len(plaintext)) + iv := ciphertext[:aes.BlockSize] + if _, err := io.ReadFull(rand.Reader, iv); err != nil { + return nil, err + } + + cbc := cipher.NewCBCEncrypter(block, iv) + cbc.CryptBlocks(ciphertext[aes.BlockSize:], plaintext) + } else { + ciphertext = make([]byte, len(plaintext)) + + cbc := cipher.NewCBCEncrypter(block, iv) + cbc.CryptBlocks(ciphertext, plaintext) + } + + return ciphertext, nil +} + +func pad(ciphertext []byte, blockSize int) []byte { + padding := blockSize - len(ciphertext)%blockSize + padtext := bytes.Repeat([]byte{byte(padding)}, padding) + return append(ciphertext, padtext...) +} + +func unpad(src []byte) ([]byte, error) { + length := len(src) + padLen := int(src[length-1]) + + if padLen > length { + return nil, fmt.Errorf("padding is greater then the length: %d / %d", padLen, length) + } + + return src[:(length - padLen)], nil +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/crypto/curve25519/curve.go b/vendor/github.com/Rhymen/go-whatsapp/crypto/curve25519/curve.go new file mode 100644 index 00000000..5ddf9c9a --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/crypto/curve25519/curve.go @@ -0,0 +1,44 @@ +/* +In cryptography, Curve25519 is an elliptic curve offering 128 bits of security and designed for use with the elliptic +curve Diffie–Hellman (ECDH) key agreement scheme. It is one of the fastest ECC curves and is not covered by any known +patents. The reference implementation is public domain software. The original Curve25519 paper defined it +as a Diffie–Hellman (DH) function. +*/ +package curve25519 + +import ( + "crypto/rand" + "golang.org/x/crypto/curve25519" + "io" +) + +/* +GenerateKey generates a public private key pair using Curve25519. +*/ +func GenerateKey() (privateKey *[32]byte, publicKey *[32]byte, err error) { + var pub, priv [32]byte + + _, err = io.ReadFull(rand.Reader, priv[:]) + if err != nil { + return nil, nil, err + } + + priv[0] &= 248 + priv[31] &= 127 + priv[31] |= 64 + + curve25519.ScalarBaseMult(&pub, &priv) + + return &priv, &pub, nil +} + +/* +GenerateSharedSecret generates the shared secret with a given public private key pair. +*/ +func GenerateSharedSecret(priv, pub [32]byte) []byte { + var secret [32]byte + + curve25519.ScalarMult(&secret, &priv, &pub) + + return secret[:] +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/crypto/hkdf/hkdf.go b/vendor/github.com/Rhymen/go-whatsapp/crypto/hkdf/hkdf.go new file mode 100644 index 00000000..e0be0587 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/crypto/hkdf/hkdf.go @@ -0,0 +1,52 @@ +/* +HKDF is a simple key derivation function (KDF) based on +a hash-based message authentication code (HMAC). It was initially proposed by its authors as a building block in +various protocols and applications, as well as to discourage the proliferation of multiple KDF mechanisms. +The main approach HKDF follows is the "extract-then-expand" paradigm, where the KDF logically consists of two modules: +the first stage takes the input keying material and "extracts" from it a fixed-length pseudorandom key, and then the +second stage "expands" this key into several additional pseudorandom keys (the output of the KDF). +*/ +package hkdf + +import ( + "crypto/hmac" + "crypto/sha256" + "fmt" + "golang.org/x/crypto/hkdf" + "io" +) + +/* +Expand expands a given key with the HKDF algorithm. +*/ +func Expand(key []byte, length int, info string) ([]byte, error) { + if info == "" { + keyBlock := hmac.New(sha256.New, key) + var out, last []byte + + var blockIndex byte = 1 + for i := 0; len(out) < length; i++ { + keyBlock.Reset() + //keyBlock.Write(append(append(last, []byte(info)...), blockIndex)) + keyBlock.Write(last) + keyBlock.Write([]byte(info)) + keyBlock.Write([]byte{blockIndex}) + last = keyBlock.Sum(nil) + blockIndex += 1 + out = append(out, last...) + } + return out[:length], nil + } else { + h := hkdf.New(sha256.New, key, nil, []byte(info)) + out := make([]byte, length) + n, err := io.ReadAtLeast(h, out, length) + if err != nil { + return nil, err + } + if n != length { + return nil, fmt.Errorf("new key to short") + } + + return out[:length], nil + } +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/errors.go b/vendor/github.com/Rhymen/go-whatsapp/errors.go new file mode 100644 index 00000000..793f8cc9 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/errors.go @@ -0,0 +1,35 @@ +package whatsapp + +import ( + "fmt" + "github.com/pkg/errors" +) + +var ( + ErrAlreadyConnected = errors.New("already connected") + ErrAlreadyLoggedIn = errors.New("already logged in") + ErrInvalidSession = errors.New("invalid session") + ErrLoginInProgress = errors.New("login or restore already running") + ErrNotConnected = errors.New("not connected") + ErrInvalidWsData = errors.New("received invalid data") + ErrConnectionTimeout = errors.New("connection timed out") + ErrMissingMessageTag = errors.New("no messageTag specified or to short") + ErrInvalidHmac = errors.New("invalid hmac") +) + +type ErrConnectionFailed struct { + Err error +} + +func (e *ErrConnectionFailed) Error() string { + return fmt.Sprintf("connection to WhatsApp servers failed: %v", e.Err) +} + +type ErrConnectionClosed struct { + Code int + Text string +} + +func (e *ErrConnectionClosed) Error() string { + return fmt.Sprintf("server closed connection,code: %d,text: %s", e.Code, e.Text) +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/go.mod b/vendor/github.com/Rhymen/go-whatsapp/go.mod new file mode 100644 index 00000000..bb071013 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/go.mod @@ -0,0 +1,8 @@ +module github.com/Rhymen/go-whatsapp + +require ( + github.com/golang/protobuf v1.3.0 + github.com/gorilla/websocket v1.4.0 + github.com/pkg/errors v0.8.1 + golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 +) diff --git a/vendor/github.com/Rhymen/go-whatsapp/go.sum b/vendor/github.com/Rhymen/go-whatsapp/go.sum new file mode 100644 index 00000000..45c18cd7 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/go.sum @@ -0,0 +1,14 @@ +github.com/golang/protobuf v1.3.0 h1:kbxbvI4Un1LUWKxufD+BiE6AEExYYgkQLQmLFqA1LFk= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= +github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= diff --git a/vendor/github.com/Rhymen/go-whatsapp/group.go b/vendor/github.com/Rhymen/go-whatsapp/group.go new file mode 100644 index 00000000..40e4515e --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/group.go @@ -0,0 +1,90 @@ +package whatsapp + +import ( + "encoding/json" + "fmt" + "time" +) + +func (wac *Conn) GetGroupMetaData(jid string) (<-chan string, error) { + data := []interface{}{"query", "GroupMetadata", jid} + return wac.writeJson(data) +} + +func (wac *Conn) CreateGroup(subject string, participants []string) (<-chan string, error) { + return wac.setGroup("create", "", subject, participants) +} + +func (wac *Conn) UpdateGroupSubject(subject string, jid string) (<-chan string, error) { + return wac.setGroup("subject", jid, subject, nil) +} + +func (wac *Conn) SetAdmin(jid string, participants []string) (<-chan string, error) { + return wac.setGroup("promote", jid, "", participants) +} + +func (wac *Conn) RemoveAdmin(jid string, participants []string) (<-chan string, error) { + return wac.setGroup("demote", jid, "", participants) +} + +func (wac *Conn) AddMember(jid string, participants []string) (<-chan string, error) { + return wac.setGroup("add", jid, "", participants) +} + +func (wac *Conn) RemoveMember(jid string, participants []string) (<-chan string, error) { + return wac.setGroup("remove", jid, "", participants) +} + +func (wac *Conn) LeaveGroup(jid string) (<-chan string, error) { + return wac.setGroup("leave", jid, "", nil) +} + +func (wac *Conn) GroupInviteLink(jid string) (string, error) { + request := []interface{}{"query", "inviteCode", jid} + ch, err := wac.writeJson(request) + if err != nil { + return "", err + } + + var response map[string]interface{} + + select { + case r := <-ch: + if err := json.Unmarshal([]byte(r), &response); err != nil { + return "", fmt.Errorf("error decoding response message: %v\n", err) + } + case <-time.After(wac.msgTimeout): + return "", fmt.Errorf("request timed out") + } + + if int(response["status"].(float64)) != 200 { + return "", fmt.Errorf("request responded with %d", response["status"]) + } + + return response["code"].(string), nil +} + +func (wac *Conn) GroupAcceptInviteCode(code string) (jid string, err error) { + request := []interface{}{"action", "invite", code} + ch, err := wac.writeJson(request) + if err != nil { + return "", err + } + + var response map[string]interface{} + + select { + case r := <-ch: + if err := json.Unmarshal([]byte(r), &response); err != nil { + return "", fmt.Errorf("error decoding response message: %v\n", err) + } + case <-time.After(wac.msgTimeout): + return "", fmt.Errorf("request timed out") + } + + if int(response["status"].(float64)) != 200 { + return "", fmt.Errorf("request responded with %d", response["status"]) + } + + return response["gid"].(string), nil +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/handler.go b/vendor/github.com/Rhymen/go-whatsapp/handler.go new file mode 100644 index 00000000..7abd55f3 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/handler.go @@ -0,0 +1,191 @@ +package whatsapp + +import ( + "fmt" + "os" + + "github.com/Rhymen/go-whatsapp/binary" + "github.com/Rhymen/go-whatsapp/binary/proto" +) + +/* +The Handler interface is the minimal interface that needs to be implemented +to be accepted as a valid handler for our dispatching system. +The minimal handler is used to dispatch error messages. These errors occur on unexpected behavior by the websocket +connection or if we are unable to handle or interpret an incoming message. Error produced by user actions are not +dispatched through this handler. They are returned as an error on the specific function call. +*/ +type Handler interface { + HandleError(err error) +} + +/* +The TextMessageHandler interface needs to be implemented to receive text messages dispatched by the dispatcher. +*/ +type TextMessageHandler interface { + Handler + HandleTextMessage(message TextMessage) +} + +/* +The ImageMessageHandler interface needs to be implemented to receive image messages dispatched by the dispatcher. +*/ +type ImageMessageHandler interface { + Handler + HandleImageMessage(message ImageMessage) +} + +/* +The VideoMessageHandler interface needs to be implemented to receive video messages dispatched by the dispatcher. +*/ +type VideoMessageHandler interface { + Handler + HandleVideoMessage(message VideoMessage) +} + +/* +The AudioMessageHandler interface needs to be implemented to receive audio messages dispatched by the dispatcher. +*/ +type AudioMessageHandler interface { + Handler + HandleAudioMessage(message AudioMessage) +} + +/* +The DocumentMessageHandler interface needs to be implemented to receive document messages dispatched by the dispatcher. +*/ +type DocumentMessageHandler interface { + Handler + HandleDocumentMessage(message DocumentMessage) +} + +/* +The JsonMessageHandler interface needs to be implemented to receive json messages dispatched by the dispatcher. +These json messages contain status updates of every kind sent by WhatsAppWeb servers. WhatsAppWeb uses these messages +to built a Store, which is used to save these "secondary" information. These messages may contain +presence (available, last see) information, or just the battery status of your phone. +*/ +type JsonMessageHandler interface { + Handler + HandleJsonMessage(message string) +} + +/** +The RawMessageHandler interface needs to be implemented to receive raw messages dispatched by the dispatcher. +Raw messages are the raw protobuf structs instead of the easy-to-use structs in TextMessageHandler, ImageMessageHandler, etc.. +*/ +type RawMessageHandler interface { + Handler + HandleRawMessage(message *proto.WebMessageInfo) +} + +/* +AddHandler adds an handler to the list of handler that receive dispatched messages. +The provided handler must at least implement the Handler interface. Additionally implemented +handlers(TextMessageHandler, ImageMessageHandler) are optional. At runtime it is checked if they are implemented +and they are called if so and needed. +*/ +func (wac *Conn) AddHandler(handler Handler) { + wac.handler = append(wac.handler, handler) +} + +// RemoveHandler removes a handler from the list of handlers that receive dispatched messages. +func (wac *Conn) RemoveHandler(handler Handler) bool { + i := -1 + for k, v := range wac.handler { + if v == handler { + i = k + break + } + } + if i > -1 { + wac.handler = append(wac.handler[:i], wac.handler[i+1:]...) + return true + } + return false +} + +// RemoveHandlers empties the list of handlers that receive dispatched messages. +func (wac *Conn) RemoveHandlers() { + wac.handler = make([]Handler, 0) +} + +func (wac *Conn) handle(message interface{}) { + switch m := message.(type) { + case error: + for _, h := range wac.handler { + go h.HandleError(m) + } + case string: + for _, h := range wac.handler { + if x, ok := h.(JsonMessageHandler); ok { + go x.HandleJsonMessage(m) + } + } + case TextMessage: + for _, h := range wac.handler { + if x, ok := h.(TextMessageHandler); ok { + go x.HandleTextMessage(m) + } + } + case ImageMessage: + for _, h := range wac.handler { + if x, ok := h.(ImageMessageHandler); ok { + go x.HandleImageMessage(m) + } + } + case VideoMessage: + for _, h := range wac.handler { + if x, ok := h.(VideoMessageHandler); ok { + go x.HandleVideoMessage(m) + } + } + case AudioMessage: + for _, h := range wac.handler { + if x, ok := h.(AudioMessageHandler); ok { + go x.HandleAudioMessage(m) + } + } + case DocumentMessage: + for _, h := range wac.handler { + if x, ok := h.(DocumentMessageHandler); ok { + go x.HandleDocumentMessage(m) + } + } + case *proto.WebMessageInfo: + for _, h := range wac.handler { + if x, ok := h.(RawMessageHandler); ok { + go x.HandleRawMessage(m) + } + } + } + +} + +func (wac *Conn) dispatch(msg interface{}) { + if msg == nil { + return + } + + switch message := msg.(type) { + case *binary.Node: + if message.Description == "action" { + if con, ok := message.Content.([]interface{}); ok { + for a := range con { + if v, ok := con[a].(*proto.WebMessageInfo); ok { + wac.handle(v) + wac.handle(parseProtoMessage(v)) + } + } + } + } else if message.Description == "response" && message.Attributes["type"] == "contacts" { + wac.updateContacts(message.Content) + } + case error: + wac.handle(message) + case string: + wac.handle(message) + default: + fmt.Fprintf(os.Stderr, "unknown type in dipatcher chan: %T", msg) + } +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/media.go b/vendor/github.com/Rhymen/go-whatsapp/media.go new file mode 100644 index 00000000..06d48864 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/media.go @@ -0,0 +1,199 @@ +package whatsapp + +import ( + "bytes" + "crypto/hmac" + "crypto/rand" + "crypto/sha256" + "encoding/base64" + "encoding/json" + "fmt" + "github.com/Rhymen/go-whatsapp/crypto/cbc" + "github.com/Rhymen/go-whatsapp/crypto/hkdf" + "io" + "io/ioutil" + "mime/multipart" + "net/http" + "os" + "strings" + "time" +) + +func Download(url string, mediaKey []byte, appInfo MediaType, fileLength int) ([]byte, error) { + if url == "" { + return nil, fmt.Errorf("no url present") + } + file, mac, err := downloadMedia(url) + if err != nil { + return nil, err + } + iv, cipherKey, macKey, _, err := getMediaKeys(mediaKey, appInfo) + if err != nil { + return nil, err + } + if err = validateMedia(iv, file, macKey, mac); err != nil { + return nil, err + } + data, err := cbc.Decrypt(cipherKey, iv, file) + if err != nil { + return nil, err + } + if len(data) != fileLength { + return nil, fmt.Errorf("file length does not match") + } + return data, nil +} + +func validateMedia(iv []byte, file []byte, macKey []byte, mac []byte) error { + h := hmac.New(sha256.New, macKey) + n, err := h.Write(append(iv, file...)) + if err != nil { + return err + } + if n < 10 { + return fmt.Errorf("hash to short") + } + if !hmac.Equal(h.Sum(nil)[:10], mac) { + return fmt.Errorf("invalid media hmac") + } + return nil +} + +func getMediaKeys(mediaKey []byte, appInfo MediaType) (iv, cipherKey, macKey, refKey []byte, err error) { + mediaKeyExpanded, err := hkdf.Expand(mediaKey, 112, string(appInfo)) + if err != nil { + return nil, nil, nil, nil, err + } + return mediaKeyExpanded[:16], mediaKeyExpanded[16:48], mediaKeyExpanded[48:80], mediaKeyExpanded[80:], nil +} + +func downloadMedia(url string) (file []byte, mac []byte, err error) { + resp, err := http.Get(url) + if err != nil { + return nil, nil, err + } + if resp.StatusCode != 200 { + return nil, nil, fmt.Errorf("download failed") + } + defer resp.Body.Close() + if resp.ContentLength <= 10 { + return nil, nil, fmt.Errorf("file to short") + } + data, err := ioutil.ReadAll(resp.Body) + n := len(data) + if err != nil { + return nil, nil, err + } + return data[:n-10], data[n-10 : n], nil +} + +func (wac *Conn) Upload(reader io.Reader, appInfo MediaType) (url string, mediaKey []byte, fileEncSha256 []byte, fileSha256 []byte, fileLength uint64, err error) { + data, err := ioutil.ReadAll(reader) + if err != nil { + return "", nil, nil, nil, 0, err + } + + mediaKey = make([]byte, 32) + rand.Read(mediaKey) + + iv, cipherKey, macKey, _, err := getMediaKeys(mediaKey, appInfo) + if err != nil { + return "", nil, nil, nil, 0, err + } + + enc, err := cbc.Encrypt(cipherKey, iv, data) + if err != nil { + return "", nil, nil, nil, 0, err + } + + fileLength = uint64(len(data)) + + h := hmac.New(sha256.New, macKey) + h.Write(append(iv, enc...)) + mac := h.Sum(nil)[:10] + + sha := sha256.New() + sha.Write(data) + fileSha256 = sha.Sum(nil) + + sha.Reset() + sha.Write(append(enc, mac...)) + fileEncSha256 = sha.Sum(nil) + + var filetype string + switch appInfo { + case MediaImage: + filetype = "image" + case MediaAudio: + filetype = "audio" + case MediaDocument: + filetype = "document" + case MediaVideo: + filetype = "video" + } + + uploadReq := []interface{}{"action", "encr_upload", filetype, base64.StdEncoding.EncodeToString(fileEncSha256)} + ch, err := wac.writeJson(uploadReq) + if err != nil { + return "", nil, nil, nil, 0, err + } + + var resp map[string]interface{} + select { + case r := <-ch: + if err = json.Unmarshal([]byte(r), &resp); err != nil { + return "", nil, nil, nil, 0, fmt.Errorf("error decoding upload response: %v\n", err) + } + case <-time.After(wac.msgTimeout): + return "", nil, nil, nil, 0, fmt.Errorf("restore session init timed out") + } + + if int(resp["status"].(float64)) != 200 { + return "", nil, nil, nil, 0, fmt.Errorf("upload responsed with %d", resp["status"]) + } + + var b bytes.Buffer + w := multipart.NewWriter(&b) + hashWriter, err := w.CreateFormField("hash") + if err != nil { + fmt.Fprintf(os.Stderr, "%v\n", err) + } + io.Copy(hashWriter, strings.NewReader(base64.StdEncoding.EncodeToString(fileEncSha256))) + + fileWriter, err := w.CreateFormFile("file", "blob") + if err != nil { + fmt.Fprintf(os.Stderr, "%v\n", err) + } + io.Copy(fileWriter, bytes.NewReader(append(enc, mac...))) + err = w.Close() + if err != nil { + fmt.Fprintf(os.Stderr, "%v\n", err) + } + + req, err := http.NewRequest("POST", resp["url"].(string), &b) + if err != nil { + return "", nil, nil, nil, 0, err + } + + req.Header.Set("Content-Type", w.FormDataContentType()) + req.Header.Set("Origin", "https://web.whatsapp.com") + req.Header.Set("Referer", "https://web.whatsapp.com/") + + req.URL.Query().Set("f", "j") + + client := &http.Client{} + // Submit the request + res, err := client.Do(req) + if err != nil { + return "", nil, nil, nil, 0, err + } + + if res.StatusCode != http.StatusOK { + return "", nil, nil, nil, 0, fmt.Errorf("upload failed with status code %d", res.StatusCode) + } + + var jsonRes map[string]string + json.NewDecoder(res.Body).Decode(&jsonRes) + + return jsonRes["url"], mediaKey, fileEncSha256, fileSha256, fileLength, nil +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/message.go b/vendor/github.com/Rhymen/go-whatsapp/message.go new file mode 100644 index 00000000..21347361 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/message.go @@ -0,0 +1,444 @@ +package whatsapp + +import ( + "encoding/hex" + "encoding/json" + "fmt" + "github.com/Rhymen/go-whatsapp/binary" + "github.com/Rhymen/go-whatsapp/binary/proto" + "io" + "math/rand" + "strconv" + "strings" + "time" +) + +type MediaType string + +const ( + MediaImage MediaType = "WhatsApp Image Keys" + MediaVideo MediaType = "WhatsApp Video Keys" + MediaAudio MediaType = "WhatsApp Audio Keys" + MediaDocument MediaType = "WhatsApp Document Keys" +) + +func (wac *Conn) Send(msg interface{}) error { + var err error + var ch <-chan string + + switch m := msg.(type) { + case *proto.WebMessageInfo: + ch, err = wac.sendProto(m) + case TextMessage: + ch, err = wac.sendProto(getTextProto(m)) + case ImageMessage: + m.url, m.mediaKey, m.fileEncSha256, m.fileSha256, m.fileLength, err = wac.Upload(m.Content, MediaImage) + if err != nil { + return fmt.Errorf("image upload failed: %v", err) + } + ch, err = wac.sendProto(getImageProto(m)) + case VideoMessage: + m.url, m.mediaKey, m.fileEncSha256, m.fileSha256, m.fileLength, err = wac.Upload(m.Content, MediaVideo) + if err != nil { + return fmt.Errorf("video upload failed: %v", err) + } + ch, err = wac.sendProto(getVideoProto(m)) + case DocumentMessage: + m.url, m.mediaKey, m.fileEncSha256, m.fileSha256, m.fileLength, err = wac.Upload(m.Content, MediaDocument) + if err != nil { + return fmt.Errorf("document upload failed: %v", err) + } + ch, err = wac.sendProto(getDocumentProto(m)) + case AudioMessage: + m.url, m.mediaKey, m.fileEncSha256, m.fileSha256, m.fileLength, err = wac.Upload(m.Content, MediaAudio) + if err != nil { + return fmt.Errorf("audio upload failed: %v", err) + } + ch, err = wac.sendProto(getAudioProto(m)) + default: + return fmt.Errorf("cannot match type %T, use message types declared in the package", msg) + } + + if err != nil { + return fmt.Errorf("could not send proto: %v", err) + } + + select { + case response := <-ch: + var resp map[string]interface{} + if err = json.Unmarshal([]byte(response), &resp); err != nil { + return fmt.Errorf("error decoding sending response: %v\n", err) + } + if int(resp["status"].(float64)) != 200 { + return fmt.Errorf("message sending responded with %d", resp["status"]) + } + case <-time.After(wac.msgTimeout): + return fmt.Errorf("sending message timed out") + } + + return nil +} + +func (wac *Conn) sendProto(p *proto.WebMessageInfo) (<-chan string, error) { + n := binary.Node{ + Description: "action", + Attributes: map[string]string{ + "type": "relay", + "epoch": strconv.Itoa(wac.msgCount), + }, + Content: []interface{}{p}, + } + return wac.writeBinary(n, message, ignore, p.Key.GetId()) +} + +func init() { + rand.Seed(time.Now().UTC().UnixNano()) +} + +/* +MessageInfo contains general message information. It is part of every of every message type. +*/ +type MessageInfo struct { + Id string + RemoteJid string + SenderJid string + FromMe bool + Timestamp uint64 + PushName string + Status MessageStatus + QuotedMessageID string + + Source *proto.WebMessageInfo +} + +type MessageStatus int + +const ( + Error MessageStatus = 0 + Pending = 1 + ServerAck = 2 + DeliveryAck = 3 + Read = 4 + Played = 5 +) + +func getMessageInfo(msg *proto.WebMessageInfo) MessageInfo { + return MessageInfo{ + Id: msg.GetKey().GetId(), + RemoteJid: msg.GetKey().GetRemoteJid(), + SenderJid: msg.GetKey().GetParticipant(), + FromMe: msg.GetKey().GetFromMe(), + Timestamp: msg.GetMessageTimestamp(), + Status: MessageStatus(msg.GetStatus()), + PushName: msg.GetPushName(), + Source: msg, + } +} + +func getInfoProto(info *MessageInfo) *proto.WebMessageInfo { + if info.Id == "" || len(info.Id) < 2 { + b := make([]byte, 10) + rand.Read(b) + info.Id = strings.ToUpper(hex.EncodeToString(b)) + } + if info.Timestamp == 0 { + info.Timestamp = uint64(time.Now().Unix()) + } + info.FromMe = true + + status := proto.WebMessageInfo_STATUS(info.Status) + + return &proto.WebMessageInfo{ + Key: &proto.MessageKey{ + FromMe: &info.FromMe, + RemoteJid: &info.RemoteJid, + Id: &info.Id, + }, + MessageTimestamp: &info.Timestamp, + Status: &status, + } +} + +/* +TextMessage represents a text message. +*/ +type TextMessage struct { + Info MessageInfo + Text string +} + +func getTextMessage(msg *proto.WebMessageInfo) TextMessage { + text := TextMessage{Info: getMessageInfo(msg)} + if m := msg.GetMessage().GetExtendedTextMessage(); m != nil { + text.Text = m.GetText() + text.Info.QuotedMessageID = m.GetContextInfo().GetStanzaId() + } else { + text.Text = msg.GetMessage().GetConversation() + } + return text +} + +func getTextProto(msg TextMessage) *proto.WebMessageInfo { + p := getInfoProto(&msg.Info) + p.Message = &proto.Message{ + Conversation: &msg.Text, + } + return p +} + +/* +ImageMessage represents a image message. Unexported fields are needed for media up/downloading and media validation. +Provide a io.Reader as Content for message sending. +*/ +type ImageMessage struct { + Info MessageInfo + Caption string + Thumbnail []byte + Type string + Content io.Reader + url string + mediaKey []byte + fileEncSha256 []byte + fileSha256 []byte + fileLength uint64 +} + +func getImageMessage(msg *proto.WebMessageInfo) ImageMessage { + image := msg.GetMessage().GetImageMessage() + return ImageMessage{ + Info: getMessageInfo(msg), + Caption: image.GetCaption(), + Thumbnail: image.GetJpegThumbnail(), + url: image.GetUrl(), + mediaKey: image.GetMediaKey(), + Type: image.GetMimetype(), + fileEncSha256: image.GetFileEncSha256(), + fileSha256: image.GetFileSha256(), + fileLength: image.GetFileLength(), + } +} + +func getImageProto(msg ImageMessage) *proto.WebMessageInfo { + p := getInfoProto(&msg.Info) + p.Message = &proto.Message{ + ImageMessage: &proto.ImageMessage{ + Caption: &msg.Caption, + JpegThumbnail: msg.Thumbnail, + Url: &msg.url, + MediaKey: msg.mediaKey, + Mimetype: &msg.Type, + FileEncSha256: msg.fileEncSha256, + FileSha256: msg.fileSha256, + FileLength: &msg.fileLength, + }, + } + return p +} + +/* +Download is the function to retrieve media data. The media gets downloaded, validated and returned. +*/ +func (m *ImageMessage) Download() ([]byte, error) { + return Download(m.url, m.mediaKey, MediaImage, int(m.fileLength)) +} + +/* +VideoMessage represents a video message. Unexported fields are needed for media up/downloading and media validation. +Provide a io.Reader as Content for message sending. +*/ +type VideoMessage struct { + Info MessageInfo + Caption string + Thumbnail []byte + Length uint32 + Type string + Content io.Reader + url string + mediaKey []byte + fileEncSha256 []byte + fileSha256 []byte + fileLength uint64 +} + +func getVideoMessage(msg *proto.WebMessageInfo) VideoMessage { + vid := msg.GetMessage().GetVideoMessage() + return VideoMessage{ + Info: getMessageInfo(msg), + Caption: vid.GetCaption(), + Thumbnail: vid.GetJpegThumbnail(), + url: vid.GetUrl(), + mediaKey: vid.GetMediaKey(), + Length: vid.GetSeconds(), + Type: vid.GetMimetype(), + fileEncSha256: vid.GetFileEncSha256(), + fileSha256: vid.GetFileSha256(), + fileLength: vid.GetFileLength(), + } +} + +func getVideoProto(msg VideoMessage) *proto.WebMessageInfo { + p := getInfoProto(&msg.Info) + p.Message = &proto.Message{ + VideoMessage: &proto.VideoMessage{ + Caption: &msg.Caption, + JpegThumbnail: msg.Thumbnail, + Url: &msg.url, + MediaKey: msg.mediaKey, + Seconds: &msg.Length, + FileEncSha256: msg.fileEncSha256, + FileSha256: msg.fileSha256, + FileLength: &msg.fileLength, + Mimetype: &msg.Type, + }, + } + return p +} + +/* +Download is the function to retrieve media data. The media gets downloaded, validated and returned. +*/ +func (m *VideoMessage) Download() ([]byte, error) { + return Download(m.url, m.mediaKey, MediaVideo, int(m.fileLength)) +} + +/* +AudioMessage represents a audio message. Unexported fields are needed for media up/downloading and media validation. +Provide a io.Reader as Content for message sending. +*/ +type AudioMessage struct { + Info MessageInfo + Length uint32 + Type string + Content io.Reader + url string + mediaKey []byte + fileEncSha256 []byte + fileSha256 []byte + fileLength uint64 +} + +func getAudioMessage(msg *proto.WebMessageInfo) AudioMessage { + aud := msg.GetMessage().GetAudioMessage() + return AudioMessage{ + Info: getMessageInfo(msg), + url: aud.GetUrl(), + mediaKey: aud.GetMediaKey(), + Length: aud.GetSeconds(), + Type: aud.GetMimetype(), + fileEncSha256: aud.GetFileEncSha256(), + fileSha256: aud.GetFileSha256(), + fileLength: aud.GetFileLength(), + } +} + +func getAudioProto(msg AudioMessage) *proto.WebMessageInfo { + p := getInfoProto(&msg.Info) + p.Message = &proto.Message{ + AudioMessage: &proto.AudioMessage{ + Url: &msg.url, + MediaKey: msg.mediaKey, + Seconds: &msg.Length, + FileEncSha256: msg.fileEncSha256, + FileSha256: msg.fileSha256, + FileLength: &msg.fileLength, + Mimetype: &msg.Type, + }, + } + return p +} + +/* +Download is the function to retrieve media data. The media gets downloaded, validated and returned. +*/ +func (m *AudioMessage) Download() ([]byte, error) { + return Download(m.url, m.mediaKey, MediaAudio, int(m.fileLength)) +} + +/* +DocumentMessage represents a document message. Unexported fields are needed for media up/downloading and media +validation. Provide a io.Reader as Content for message sending. +*/ +type DocumentMessage struct { + Info MessageInfo + Title string + PageCount uint32 + Type string + FileName string + Thumbnail []byte + Content io.Reader + url string + mediaKey []byte + fileEncSha256 []byte + fileSha256 []byte + fileLength uint64 +} + +func getDocumentMessage(msg *proto.WebMessageInfo) DocumentMessage { + doc := msg.GetMessage().GetDocumentMessage() + return DocumentMessage{ + Info: getMessageInfo(msg), + Title: doc.GetTitle(), + PageCount: doc.GetPageCount(), + Type: doc.GetMimetype(), + FileName: doc.GetFileName(), + Thumbnail: doc.GetJpegThumbnail(), + url: doc.GetUrl(), + mediaKey: doc.GetMediaKey(), + fileEncSha256: doc.GetFileEncSha256(), + fileSha256: doc.GetFileSha256(), + fileLength: doc.GetFileLength(), + } +} + +func getDocumentProto(msg DocumentMessage) *proto.WebMessageInfo { + p := getInfoProto(&msg.Info) + p.Message = &proto.Message{ + DocumentMessage: &proto.DocumentMessage{ + JpegThumbnail: msg.Thumbnail, + Url: &msg.url, + MediaKey: msg.mediaKey, + FileEncSha256: msg.fileEncSha256, + FileSha256: msg.fileSha256, + FileLength: &msg.fileLength, + PageCount: &msg.PageCount, + Title: &msg.Title, + Mimetype: &msg.Type, + }, + } + return p +} + +/* +Download is the function to retrieve media data. The media gets downloaded, validated and returned. +*/ +func (m *DocumentMessage) Download() ([]byte, error) { + return Download(m.url, m.mediaKey, MediaDocument, int(m.fileLength)) +} + +func parseProtoMessage(msg *proto.WebMessageInfo) interface{} { + switch { + + case msg.GetMessage().GetAudioMessage() != nil: + return getAudioMessage(msg) + + case msg.GetMessage().GetImageMessage() != nil: + return getImageMessage(msg) + + case msg.GetMessage().GetVideoMessage() != nil: + return getVideoMessage(msg) + + case msg.GetMessage().GetDocumentMessage() != nil: + return getDocumentMessage(msg) + + case msg.GetMessage().GetConversation() != "": + return getTextMessage(msg) + + case msg.GetMessage().GetExtendedTextMessage() != nil: + return getTextMessage(msg) + + default: + //cannot match message + } + + return nil +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/read.go b/vendor/github.com/Rhymen/go-whatsapp/read.go new file mode 100644 index 00000000..7281ccff --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/read.go @@ -0,0 +1,111 @@ +package whatsapp + +import ( + "crypto/hmac" + "crypto/sha256" + "github.com/Rhymen/go-whatsapp/binary" + "github.com/Rhymen/go-whatsapp/crypto/cbc" + "github.com/gorilla/websocket" + "github.com/pkg/errors" + "io" + "io/ioutil" + "strings" +) + +func (wac *Conn) readPump() { + defer wac.wg.Done() + + var readErr error + var msgType int + var reader io.Reader + + for { + readerFound := make(chan struct{}) + go func() { + msgType, reader, readErr = wac.ws.conn.NextReader() + close(readerFound) + }() + select { + case <-readerFound: + if readErr != nil { + wac.handle(&ErrConnectionFailed{Err: readErr}) + _, _ = wac.Disconnect() + return + } + msg, err := ioutil.ReadAll(reader) + if err != nil { + wac.handle(errors.Wrap(err, "error reading message from Reader")) + continue + } + err = wac.processReadData(msgType, msg) + if err != nil { + wac.handle(errors.Wrap(err, "error processing data")) + } + case <-wac.ws.close: + return + } + } +} + +func (wac *Conn) processReadData(msgType int, msg []byte) error { + data := strings.SplitN(string(msg), ",", 2) + + if data[0][0] == '!' { //Keep-Alive Timestamp + data = append(data, data[0][1:]) //data[1] + data[0] = "!" + } + + if len(data) != 2 || len(data[1]) == 0 { + return ErrInvalidWsData + } + + wac.listener.RLock() + listener, hasListener := wac.listener.m[data[0]] + wac.listener.RUnlock() + + if hasListener { + // listener only exists for TextMessages query messages out of contact.go + // If these binary query messages can be handled another way, + // then the TextMessages, which are all JSON encoded, can directly + // be unmarshalled. The listener chan could then be changed from type + // chan string to something like chan map[string]interface{}. The unmarshalling + // in several places, especially in session.go, would then be gone. + listener <- data[1] + + wac.listener.Lock() + delete(wac.listener.m, data[0]) + wac.listener.Unlock() + } else if msgType == websocket.BinaryMessage && wac.loggedIn { + message, err := wac.decryptBinaryMessage([]byte(data[1])) + if err != nil { + return errors.Wrap(err, "error decoding binary") + } + wac.dispatch(message) + } else { //RAW json status updates + wac.handle(string(data[1])) + } + return nil +} + +func (wac *Conn) decryptBinaryMessage(msg []byte) (*binary.Node, error) { + //message validation + h2 := hmac.New(sha256.New, wac.session.MacKey) + h2.Write([]byte(msg[32:])) + if !hmac.Equal(h2.Sum(nil), msg[:32]) { + return nil, ErrInvalidHmac + } + + // message decrypt + d, err := cbc.Decrypt(wac.session.EncKey, nil, msg[32:]) + if err != nil { + return nil, errors.Wrap(err, "decrypting message with AES-CBC failed") + } + + // message unmarshal + message, err := binary.Unmarshal(d) + if err != nil { + return nil, errors.Wrap(err, "could not decode binary") + } + + return message, nil +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/session.go b/vendor/github.com/Rhymen/go-whatsapp/session.go new file mode 100644 index 00000000..b769ef5a --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/session.go @@ -0,0 +1,450 @@ +package whatsapp + +import ( + "crypto/hmac" + "crypto/rand" + "crypto/sha256" + "encoding/base64" + "encoding/json" + "fmt" + "sync/atomic" + "time" + + "github.com/Rhymen/go-whatsapp/crypto/cbc" + "github.com/Rhymen/go-whatsapp/crypto/curve25519" + "github.com/Rhymen/go-whatsapp/crypto/hkdf" +) + +/* +Session contains session individual information. To be able to resume the connection without scanning the qr code +every time you should save the Session returned by Login and use RestoreSession the next time you want to login. +Every successful created connection returns a new Session. The Session(ClientToken, ServerToken) is altered after +every re-login and should be saved every time. +*/ +type Session struct { + ClientId string + ClientToken string + ServerToken string + EncKey []byte + MacKey []byte + Wid string +} + +type Info struct { + Battery int + Platform string + Connected bool + Pushname string + Wid string + Lc string + Phone *PhoneInfo + Plugged bool + Tos int + Lg string + Is24h bool +} + +type PhoneInfo struct { + Mcc string + Mnc string + OsVersion string + DeviceManufacturer string + DeviceModel string + OsBuildNumber string + WaVersion string +} + +func newInfoFromReq(info map[string]interface{}) *Info { + phoneInfo := info["phone"].(map[string]interface{}) + + ret := &Info{ + Battery: int(info["battery"].(float64)), + Platform: info["platform"].(string), + Connected: info["connected"].(bool), + Pushname: info["pushname"].(string), + Wid: info["wid"].(string), + Lc: info["lc"].(string), + Phone: &PhoneInfo{ + phoneInfo["mcc"].(string), + phoneInfo["mnc"].(string), + phoneInfo["os_version"].(string), + phoneInfo["device_manufacturer"].(string), + phoneInfo["device_model"].(string), + phoneInfo["os_build_number"].(string), + phoneInfo["wa_version"].(string), + }, + Plugged: info["plugged"].(bool), + Lg: info["lg"].(string), + Tos: int(info["tos"].(float64)), + } + + if is24h, ok := info["is24h"]; ok { + ret.Is24h = is24h.(bool) + } + + return ret +} + +/* +SetClientName sets the long and short client names that are sent to WhatsApp when logging in and displayed in the +WhatsApp Web device list. As the values are only sent when logging in, changing them after logging in is not possible. +*/ +func (wac *Conn) SetClientName(long, short string) error { + if wac.session != nil && (wac.session.EncKey != nil || wac.session.MacKey != nil) { + return fmt.Errorf("cannot change client name after logging in") + } + wac.longClientName, wac.shortClientName = long, short + return nil +} + +/* +Login is the function that creates a new whatsapp session and logs you in. If you do not want to scan the qr code +every time, you should save the returned session and use RestoreSession the next time. Login takes a writable channel +as an parameter. This channel is used to push the data represented by the qr code back to the user. The received data +should be displayed as an qr code in a way you prefer. To print a qr code to console you can use: +github.com/Baozisoftware/qrcode-terminal-go Example login procedure: + wac, err := whatsapp.NewConn(5 * time.Second) + if err != nil { + panic(err) + } + + qr := make(chan string) + go func() { + terminal := qrcodeTerminal.New() + terminal.Get(<-qr).Print() + }() + + session, err := wac.Login(qr) + if err != nil { + fmt.Fprintf(os.Stderr, "error during login: %v\n", err) + } + fmt.Printf("login successful, session: %v\n", session) +*/ +func (wac *Conn) Login(qrChan chan<- string) (Session, error) { + session := Session{} + //Makes sure that only a single Login or Restore can happen at the same time + if !atomic.CompareAndSwapUint32(&wac.sessionLock, 0, 1) { + return session, ErrLoginInProgress + } + defer atomic.StoreUint32(&wac.sessionLock, 0) + + if wac.loggedIn { + return session, ErrAlreadyLoggedIn + } + + if err := wac.connect(); err != nil && err != ErrAlreadyConnected { + return session, err + } + + //logged in?!? + if wac.session != nil && (wac.session.EncKey != nil || wac.session.MacKey != nil) { + return session, fmt.Errorf("already logged in") + } + + clientId := make([]byte, 16) + _, err := rand.Read(clientId) + if err != nil { + return session, fmt.Errorf("error creating random ClientId: %v", err) + } + + session.ClientId = base64.StdEncoding.EncodeToString(clientId) + //oldVersion=8691 + login := []interface{}{"admin", "init", []int{0, 3, 225}, []string{wac.longClientName, wac.shortClientName}, session.ClientId, true} + loginChan, err := wac.writeJson(login) + if err != nil { + return session, fmt.Errorf("error writing login: %v\n", err) + } + + var r string + select { + case r = <-loginChan: + case <-time.After(wac.msgTimeout): + return session, fmt.Errorf("login connection timed out") + } + + var resp map[string]interface{} + if err = json.Unmarshal([]byte(r), &resp); err != nil { + return session, fmt.Errorf("error decoding login resp: %v\n", err) + } + + ref := resp["ref"].(string) + + priv, pub, err := curve25519.GenerateKey() + if err != nil { + return session, fmt.Errorf("error generating keys: %v\n", err) + } + + //listener for Login response + s1 := make(chan string, 1) + wac.listener.Lock() + wac.listener.m["s1"] = s1 + wac.listener.Unlock() + + qrChan <- fmt.Sprintf("%v,%v,%v", ref, base64.StdEncoding.EncodeToString(pub[:]), session.ClientId) + + var resp2 []interface{} + select { + case r1 := <-s1: + if err := json.Unmarshal([]byte(r1), &resp2); err != nil { + return session, fmt.Errorf("error decoding qr code resp: %v", err) + } + case <-time.After(time.Duration(resp["ttl"].(float64)) * time.Millisecond): + return session, fmt.Errorf("qr code scan timed out") + } + + info := resp2[1].(map[string]interface{}) + + wac.Info = newInfoFromReq(info) + + session.ClientToken = info["clientToken"].(string) + session.ServerToken = info["serverToken"].(string) + session.Wid = info["wid"].(string) + s := info["secret"].(string) + decodedSecret, err := base64.StdEncoding.DecodeString(s) + if err != nil { + return session, fmt.Errorf("error decoding secret: %v", err) + } + + var pubKey [32]byte + copy(pubKey[:], decodedSecret[:32]) + + sharedSecret := curve25519.GenerateSharedSecret(*priv, pubKey) + + hash := sha256.New + + nullKey := make([]byte, 32) + h := hmac.New(hash, nullKey) + h.Write(sharedSecret) + + sharedSecretExtended, err := hkdf.Expand(h.Sum(nil), 80, "") + if err != nil { + return session, fmt.Errorf("hkdf error: %v", err) + } + + //login validation + checkSecret := make([]byte, 112) + copy(checkSecret[:32], decodedSecret[:32]) + copy(checkSecret[32:], decodedSecret[64:]) + h2 := hmac.New(hash, sharedSecretExtended[32:64]) + h2.Write(checkSecret) + if !hmac.Equal(h2.Sum(nil), decodedSecret[32:64]) { + return session, fmt.Errorf("abort login") + } + + keysEncrypted := make([]byte, 96) + copy(keysEncrypted[:16], sharedSecretExtended[64:]) + copy(keysEncrypted[16:], decodedSecret[64:]) + + keyDecrypted, err := cbc.Decrypt(sharedSecretExtended[:32], nil, keysEncrypted) + if err != nil { + return session, fmt.Errorf("error decryptAes: %v", err) + } + + session.EncKey = keyDecrypted[:32] + session.MacKey = keyDecrypted[32:64] + wac.session = &session + wac.loggedIn = true + + return session, nil +} + +//TODO: GoDoc +/* +Basically the old RestoreSession functionality +*/ +func (wac *Conn) RestoreWithSession(session Session) (_ Session, err error) { + if wac.loggedIn { + return Session{}, ErrAlreadyLoggedIn + } + old := wac.session + defer func() { + if err != nil { + wac.session = old + } + }() + wac.session = &session + + if err = wac.Restore(); err != nil { + wac.session = nil + return Session{}, err + } + return *wac.session, nil +} + +/*//TODO: GoDoc +RestoreSession is the function that restores a given session. It will try to reestablish the connection to the +WhatsAppWeb servers with the provided session. If it succeeds it will return a new session. This new session has to be +saved because the Client and Server-Token will change after every login. Logging in with old tokens is possible, but not +suggested. If so, a challenge has to be resolved which is just another possible point of failure. +*/ +func (wac *Conn) Restore() error { + //Makes sure that only a single Login or Restore can happen at the same time + if !atomic.CompareAndSwapUint32(&wac.sessionLock, 0, 1) { + return ErrLoginInProgress + } + defer atomic.StoreUint32(&wac.sessionLock, 0) + + if wac.session == nil { + return ErrInvalidSession + } + + if err := wac.connect(); err != nil && err != ErrAlreadyConnected { + return err + } + + if wac.loggedIn { + return ErrAlreadyLoggedIn + } + + //listener for Conn or challenge; s1 is not allowed to drop + s1 := make(chan string, 1) + wac.listener.Lock() + wac.listener.m["s1"] = s1 + wac.listener.Unlock() + + //admin init + init := []interface{}{"admin", "init", []int{0, 3, 225}, []string{wac.longClientName, wac.shortClientName}, wac.session.ClientId, true} + initChan, err := wac.writeJson(init) + if err != nil { + return fmt.Errorf("error writing admin init: %v\n", err) + } + + //admin login with takeover + login := []interface{}{"admin", "login", wac.session.ClientToken, wac.session.ServerToken, wac.session.ClientId, "takeover"} + loginChan, err := wac.writeJson(login) + if err != nil { + return fmt.Errorf("error writing admin login: %v\n", err) + } + + select { + case r := <-initChan: + var resp map[string]interface{} + if err = json.Unmarshal([]byte(r), &resp); err != nil { + return fmt.Errorf("error decoding login connResp: %v\n", err) + } + + if int(resp["status"].(float64)) != 200 { + return fmt.Errorf("init responded with %d", resp["status"]) + } + case <-time.After(wac.msgTimeout): + return fmt.Errorf("restore session init timed out") + } + + //wait for s1 + var connResp []interface{} + select { + case r1 := <-s1: + if err := json.Unmarshal([]byte(r1), &connResp); err != nil { + return fmt.Errorf("error decoding s1 message: %v\n", err) + } + case <-time.After(wac.msgTimeout): + + //check for an error message + select { + case r := <-loginChan: + var resp map[string]interface{} + if err = json.Unmarshal([]byte(r), &resp); err != nil { + return fmt.Errorf("error decoding login connResp: %v\n", err) + } + if int(resp["status"].(float64)) != 200 { + return fmt.Errorf("admin login responded with %d", int(resp["status"].(float64))) + } + default: + // not even an error message – assume timeout + return fmt.Errorf("restore session connection timed out") + } + } + + //check if challenge is present + if len(connResp) == 2 && connResp[0] == "Cmd" && connResp[1].(map[string]interface{})["type"] == "challenge" { + s2 := make(chan string, 1) + wac.listener.Lock() + wac.listener.m["s2"] = s2 + wac.listener.Unlock() + + if err := wac.resolveChallenge(connResp[1].(map[string]interface{})["challenge"].(string)); err != nil { + return fmt.Errorf("error resolving challenge: %v\n", err) + } + + select { + case r := <-s2: + if err := json.Unmarshal([]byte(r), &connResp); err != nil { + return fmt.Errorf("error decoding s2 message: %v\n", err) + } + case <-time.After(wac.msgTimeout): + return fmt.Errorf("restore session challenge timed out") + } + } + + //check for login 200 --> login success + select { + case r := <-loginChan: + var resp map[string]interface{} + if err = json.Unmarshal([]byte(r), &resp); err != nil { + return fmt.Errorf("error decoding login connResp: %v\n", err) + } + + if int(resp["status"].(float64)) != 200 { + return fmt.Errorf("admin login responded with %d", resp["status"]) + } + case <-time.After(wac.msgTimeout): + return fmt.Errorf("restore session login timed out") + } + + info := connResp[1].(map[string]interface{}) + + wac.Info = newInfoFromReq(info) + + //set new tokens + wac.session.ClientToken = info["clientToken"].(string) + wac.session.ServerToken = info["serverToken"].(string) + wac.session.Wid = info["wid"].(string) + wac.loggedIn = true + + return nil +} + +func (wac *Conn) resolveChallenge(challenge string) error { + decoded, err := base64.StdEncoding.DecodeString(challenge) + if err != nil { + return err + } + + h2 := hmac.New(sha256.New, wac.session.MacKey) + h2.Write([]byte(decoded)) + + ch := []interface{}{"admin", "challenge", base64.StdEncoding.EncodeToString(h2.Sum(nil)), wac.session.ServerToken, wac.session.ClientId} + challengeChan, err := wac.writeJson(ch) + if err != nil { + return fmt.Errorf("error writing challenge: %v\n", err) + } + + select { + case r := <-challengeChan: + var resp map[string]interface{} + if err := json.Unmarshal([]byte(r), &resp); err != nil { + return fmt.Errorf("error decoding login resp: %v\n", err) + } + if int(resp["status"].(float64)) != 200 { + return fmt.Errorf("challenge responded with %d\n", resp["status"]) + } + case <-time.After(wac.msgTimeout): + return fmt.Errorf("connection timed out") + } + + return nil +} + +/* +Logout is the function to logout from a WhatsApp session. Logging out means invalidating the current session. +The session can not be resumed and will disappear on your phone in the WhatsAppWeb client list. +*/ +func (wac *Conn) Logout() error { + login := []interface{}{"admin", "Conn", "disconnect"} + _, err := wac.writeJson(login) + if err != nil { + return fmt.Errorf("error writing logout: %v\n", err) + } + + return nil +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/store.go b/vendor/github.com/Rhymen/go-whatsapp/store.go new file mode 100644 index 00000000..b1c46e4a --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/store.go @@ -0,0 +1,45 @@ +package whatsapp + +import ( + "github.com/Rhymen/go-whatsapp/binary" + "strings" +) + +type Store struct { + Contacts map[string]Contact +} + +type Contact struct { + Jid string + Notify string + Name string + Short string +} + +func newStore() *Store { + return &Store{ + make(map[string]Contact), + } +} + +func (wac *Conn) updateContacts(contacts interface{}) { + c, ok := contacts.([]interface{}) + if !ok { + return + } + + for _, contact := range c { + contactNode, ok := contact.(binary.Node) + if !ok { + continue + } + + jid := strings.Replace(contactNode.Attributes["jid"], "@c.us", "@s.whatsapp.net", 1) + wac.Store.Contacts[jid] = Contact{ + jid, + contactNode.Attributes["notify"], + contactNode.Attributes["name"], + contactNode.Attributes["short"], + } + } +} diff --git a/vendor/github.com/Rhymen/go-whatsapp/write.go b/vendor/github.com/Rhymen/go-whatsapp/write.go new file mode 100644 index 00000000..4ea63dca --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/write.go @@ -0,0 +1,125 @@ +package whatsapp + +import ( + "crypto/hmac" + "crypto/sha256" + "encoding/json" + "fmt" + "github.com/Rhymen/go-whatsapp/binary" + "github.com/Rhymen/go-whatsapp/crypto/cbc" + "github.com/gorilla/websocket" + "github.com/pkg/errors" + "strconv" + "time" +) + +//writeJson enqueues a json message into the writeChan +func (wac *Conn) writeJson(data []interface{}) (<-chan string, error) { + d, err := json.Marshal(data) + if err != nil { + return nil, err + } + + ts := time.Now().Unix() + messageTag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) + bytes := []byte(fmt.Sprintf("%s,%s", messageTag, d)) + + ch, err := wac.write(websocket.TextMessage, messageTag, bytes) + if err != nil { + return nil, err + } + + wac.msgCount++ + return ch, nil +} + +func (wac *Conn) writeBinary(node binary.Node, metric metric, flag flag, messageTag string) (<-chan string, error) { + if len(messageTag) < 2 { + return nil, ErrMissingMessageTag + } + + data, err := wac.encryptBinaryMessage(node) + if err != nil { + return nil, errors.Wrap(err, "encryptBinaryMessage(node) failed") + } + + bytes := []byte(messageTag + ",") + bytes = append(bytes, byte(metric), byte(flag)) + bytes = append(bytes, data...) + + ch, err := wac.write(websocket.BinaryMessage, messageTag, bytes) + if err != nil { + return nil, errors.Wrap(err, "failed to write message") + } + + wac.msgCount++ + return ch, nil +} + +func (wac *Conn) sendKeepAlive() error { + bytes := []byte("?,,") + respChan, err := wac.write(websocket.TextMessage, "!", bytes) + if err != nil { + return errors.Wrap(err, "error sending keepAlive") + } + + select { + case resp := <-respChan: + msecs, err := strconv.ParseInt(resp, 10, 64) + if err != nil { + return errors.Wrap(err, "Error converting time string to uint") + } + wac.ServerLastSeen = time.Unix(msecs/1000, (msecs%1000)*int64(time.Millisecond)) + + case <-time.After(wac.msgTimeout): + return ErrConnectionTimeout + } + + return nil +} + +func (wac *Conn) write(messageType int, answerMessageTag string, data []byte) (<-chan string, error) { + var ch chan string + if answerMessageTag != "" { + ch = make(chan string, 1) + + wac.listener.Lock() + wac.listener.m[answerMessageTag] = ch + wac.listener.Unlock() + } + + wac.ws.Lock() + err := wac.ws.conn.WriteMessage(messageType, data) + wac.ws.Unlock() + + if err != nil { + if answerMessageTag != "" { + wac.listener.Lock() + delete(wac.listener.m, answerMessageTag) + wac.listener.Unlock() + } + return nil, errors.Wrap(err, "error writing to websocket") + } + return ch, nil +} + +func (wac *Conn) encryptBinaryMessage(node binary.Node) (data []byte, err error) { + b, err := binary.Marshal(node) + if err != nil { + return nil, errors.Wrap(err, "binary node marshal failed") + } + + cipher, err := cbc.Encrypt(wac.session.EncKey, nil, b) + if err != nil { + return nil, errors.Wrap(err, "encrypt failed") + } + + h := hmac.New(sha256.New, wac.session.MacKey) + h.Write(cipher) + hash := h.Sum(nil) + + data = append(data, hash[:32]...) + data = append(data, cipher...) + + return data, nil +} diff --git a/vendor/github.com/golang/protobuf/proto/decode.go b/vendor/github.com/golang/protobuf/proto/decode.go index d9aa3c42..63b0f08b 100644 --- a/vendor/github.com/golang/protobuf/proto/decode.go +++ b/vendor/github.com/golang/protobuf/proto/decode.go @@ -186,7 +186,6 @@ func (p *Buffer) DecodeVarint() (x uint64, err error) { if b&0x80 == 0 { goto done } - // x -= 0x80 << 63 // Always zero. return 0, errOverflow diff --git a/vendor/github.com/golang/protobuf/proto/deprecated.go b/vendor/github.com/golang/protobuf/proto/deprecated.go new file mode 100644 index 00000000..35b882c0 --- /dev/null +++ b/vendor/github.com/golang/protobuf/proto/deprecated.go @@ -0,0 +1,63 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2018 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package proto + +import "errors" + +// Deprecated: do not use. +type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 } + +// Deprecated: do not use. +func GetStats() Stats { return Stats{} } + +// Deprecated: do not use. +func MarshalMessageSet(interface{}) ([]byte, error) { + return nil, errors.New("proto: not implemented") +} + +// Deprecated: do not use. +func UnmarshalMessageSet([]byte, interface{}) error { + return errors.New("proto: not implemented") +} + +// Deprecated: do not use. +func MarshalMessageSetJSON(interface{}) ([]byte, error) { + return nil, errors.New("proto: not implemented") +} + +// Deprecated: do not use. +func UnmarshalMessageSetJSON([]byte, interface{}) error { + return errors.New("proto: not implemented") +} + +// Deprecated: do not use. +func RegisterMessageSetType(Message, int32, string) {} diff --git a/vendor/github.com/golang/protobuf/proto/equal.go b/vendor/github.com/golang/protobuf/proto/equal.go index d4db5a1c..f9b6e41b 100644 --- a/vendor/github.com/golang/protobuf/proto/equal.go +++ b/vendor/github.com/golang/protobuf/proto/equal.go @@ -246,7 +246,8 @@ func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool { return false } - m1, m2 := e1.value, e2.value + m1 := extensionAsLegacyType(e1.value) + m2 := extensionAsLegacyType(e2.value) if m1 == nil && m2 == nil { // Both have only encoded form. diff --git a/vendor/github.com/golang/protobuf/proto/extensions.go b/vendor/github.com/golang/protobuf/proto/extensions.go index 816a3b9d..fa88add3 100644 --- a/vendor/github.com/golang/protobuf/proto/extensions.go +++ b/vendor/github.com/golang/protobuf/proto/extensions.go @@ -185,9 +185,25 @@ type Extension struct { // extension will have only enc set. When such an extension is // accessed using GetExtension (or GetExtensions) desc and value // will be set. - desc *ExtensionDesc + desc *ExtensionDesc + + // value is a concrete value for the extension field. Let the type of + // desc.ExtensionType be the "API type" and the type of Extension.value + // be the "storage type". The API type and storage type are the same except: + // * For scalars (except []byte), the API type uses *T, + // while the storage type uses T. + // * For repeated fields, the API type uses []T, while the storage type + // uses *[]T. + // + // The reason for the divergence is so that the storage type more naturally + // matches what is expected of when retrieving the values through the + // protobuf reflection APIs. + // + // The value may only be populated if desc is also populated. value interface{} - enc []byte + + // enc is the raw bytes for the extension field. + enc []byte } // SetRawExtension is for testing only. @@ -334,7 +350,7 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) { // descriptors with the same field number. return nil, errors.New("proto: descriptor conflict") } - return e.value, nil + return extensionAsLegacyType(e.value), nil } if extension.ExtensionType == nil { @@ -349,11 +365,11 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) { // Remember the decoded version and drop the encoded version. // That way it is safe to mutate what we return. - e.value = v + e.value = extensionAsStorageType(v) e.desc = extension e.enc = nil emap[extension.Field] = e - return e.value, nil + return extensionAsLegacyType(e.value), nil } // defaultExtensionValue returns the default value for extension. @@ -488,7 +504,7 @@ func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error } typ := reflect.TypeOf(extension.ExtensionType) if typ != reflect.TypeOf(value) { - return errors.New("proto: bad extension value type") + return fmt.Errorf("proto: bad extension value type. got: %T, want: %T", value, extension.ExtensionType) } // nil extension values need to be caught early, because the // encoder can't distinguish an ErrNil due to a nil extension @@ -500,7 +516,7 @@ func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error } extmap := epb.extensionsWrite() - extmap[extension.Field] = Extension{desc: extension, value: value} + extmap[extension.Field] = Extension{desc: extension, value: extensionAsStorageType(value)} return nil } @@ -541,3 +557,51 @@ func RegisterExtension(desc *ExtensionDesc) { func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc { return extensionMaps[reflect.TypeOf(pb).Elem()] } + +// extensionAsLegacyType converts an value in the storage type as the API type. +// See Extension.value. +func extensionAsLegacyType(v interface{}) interface{} { + switch rv := reflect.ValueOf(v); rv.Kind() { + case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String: + // Represent primitive types as a pointer to the value. + rv2 := reflect.New(rv.Type()) + rv2.Elem().Set(rv) + v = rv2.Interface() + case reflect.Ptr: + // Represent slice types as the value itself. + switch rv.Type().Elem().Kind() { + case reflect.Slice: + if rv.IsNil() { + v = reflect.Zero(rv.Type().Elem()).Interface() + } else { + v = rv.Elem().Interface() + } + } + } + return v +} + +// extensionAsStorageType converts an value in the API type as the storage type. +// See Extension.value. +func extensionAsStorageType(v interface{}) interface{} { + switch rv := reflect.ValueOf(v); rv.Kind() { + case reflect.Ptr: + // Represent slice types as the value itself. + switch rv.Type().Elem().Kind() { + case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String: + if rv.IsNil() { + v = reflect.Zero(rv.Type().Elem()).Interface() + } else { + v = rv.Elem().Interface() + } + } + case reflect.Slice: + // Represent slice types as a pointer to the value. + if rv.Type().Elem().Kind() != reflect.Uint8 { + rv2 := reflect.New(rv.Type()) + rv2.Elem().Set(rv) + v = rv2.Interface() + } + } + return v +} diff --git a/vendor/github.com/golang/protobuf/proto/lib.go b/vendor/github.com/golang/protobuf/proto/lib.go index 75565cc6..fdd328bb 100644 --- a/vendor/github.com/golang/protobuf/proto/lib.go +++ b/vendor/github.com/golang/protobuf/proto/lib.go @@ -341,26 +341,6 @@ type Message interface { ProtoMessage() } -// Stats records allocation details about the protocol buffer encoders -// and decoders. Useful for tuning the library itself. -type Stats struct { - Emalloc uint64 // mallocs in encode - Dmalloc uint64 // mallocs in decode - Encode uint64 // number of encodes - Decode uint64 // number of decodes - Chit uint64 // number of cache hits - Cmiss uint64 // number of cache misses - Size uint64 // number of sizes -} - -// Set to true to enable stats collection. -const collectStats = false - -var stats Stats - -// GetStats returns a copy of the global Stats structure. -func GetStats() Stats { return stats } - // A Buffer is a buffer manager for marshaling and unmarshaling // protocol buffers. It may be reused between invocations to // reduce memory usage. It is not necessary to use a Buffer; @@ -960,13 +940,19 @@ func isProto3Zero(v reflect.Value) bool { return false } -// ProtoPackageIsVersion2 is referenced from generated protocol buffer files -// to assert that that code is compatible with this version of the proto package. -const ProtoPackageIsVersion2 = true +const ( + // ProtoPackageIsVersion3 is referenced from generated protocol buffer files + // to assert that that code is compatible with this version of the proto package. + ProtoPackageIsVersion3 = true + + // ProtoPackageIsVersion2 is referenced from generated protocol buffer files + // to assert that that code is compatible with this version of the proto package. + ProtoPackageIsVersion2 = true -// ProtoPackageIsVersion1 is referenced from generated protocol buffer files -// to assert that that code is compatible with this version of the proto package. -const ProtoPackageIsVersion1 = true + // ProtoPackageIsVersion1 is referenced from generated protocol buffer files + // to assert that that code is compatible with this version of the proto package. + ProtoPackageIsVersion1 = true +) // InternalMessageInfo is a type used internally by generated .pb.go files. // This type is not intended to be used by non-generated code. diff --git a/vendor/github.com/golang/protobuf/proto/message_set.go b/vendor/github.com/golang/protobuf/proto/message_set.go index 3b6ca41d..f48a7567 100644 --- a/vendor/github.com/golang/protobuf/proto/message_set.go +++ b/vendor/github.com/golang/protobuf/proto/message_set.go @@ -36,13 +36,7 @@ package proto */ import ( - "bytes" - "encoding/json" "errors" - "fmt" - "reflect" - "sort" - "sync" ) // errNoMessageTypeID occurs when a protocol buffer does not have a message type ID. @@ -145,46 +139,9 @@ func skipVarint(buf []byte) []byte { return buf[i+1:] } -// MarshalMessageSet encodes the extension map represented by m in the message set wire format. -// It is called by generated Marshal methods on protocol buffer messages with the message_set_wire_format option. -func MarshalMessageSet(exts interface{}) ([]byte, error) { - return marshalMessageSet(exts, false) -} - -// marshaMessageSet implements above function, with the opt to turn on / off deterministic during Marshal. -func marshalMessageSet(exts interface{}, deterministic bool) ([]byte, error) { - switch exts := exts.(type) { - case *XXX_InternalExtensions: - var u marshalInfo - siz := u.sizeMessageSet(exts) - b := make([]byte, 0, siz) - return u.appendMessageSet(b, exts, deterministic) - - case map[int32]Extension: - // This is an old-style extension map. - // Wrap it in a new-style XXX_InternalExtensions. - ie := XXX_InternalExtensions{ - p: &struct { - mu sync.Mutex - extensionMap map[int32]Extension - }{ - extensionMap: exts, - }, - } - - var u marshalInfo - siz := u.sizeMessageSet(&ie) - b := make([]byte, 0, siz) - return u.appendMessageSet(b, &ie, deterministic) - - default: - return nil, errors.New("proto: not an extension map") - } -} - -// UnmarshalMessageSet decodes the extension map encoded in buf in the message set wire format. +// unmarshalMessageSet decodes the extension map encoded in buf in the message set wire format. // It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option. -func UnmarshalMessageSet(buf []byte, exts interface{}) error { +func unmarshalMessageSet(buf []byte, exts interface{}) error { var m map[int32]Extension switch exts := exts.(type) { case *XXX_InternalExtensions: @@ -222,93 +179,3 @@ func UnmarshalMessageSet(buf []byte, exts interface{}) error { } return nil } - -// MarshalMessageSetJSON encodes the extension map represented by m in JSON format. -// It is called by generated MarshalJSON methods on protocol buffer messages with the message_set_wire_format option. -func MarshalMessageSetJSON(exts interface{}) ([]byte, error) { - var m map[int32]Extension - switch exts := exts.(type) { - case *XXX_InternalExtensions: - var mu sync.Locker - m, mu = exts.extensionsRead() - if m != nil { - // Keep the extensions map locked until we're done marshaling to prevent - // races between marshaling and unmarshaling the lazily-{en,de}coded - // values. - mu.Lock() - defer mu.Unlock() - } - case map[int32]Extension: - m = exts - default: - return nil, errors.New("proto: not an extension map") - } - var b bytes.Buffer - b.WriteByte('{') - - // Process the map in key order for deterministic output. - ids := make([]int32, 0, len(m)) - for id := range m { - ids = append(ids, id) - } - sort.Sort(int32Slice(ids)) // int32Slice defined in text.go - - for i, id := range ids { - ext := m[id] - msd, ok := messageSetMap[id] - if !ok { - // Unknown type; we can't render it, so skip it. - continue - } - - if i > 0 && b.Len() > 1 { - b.WriteByte(',') - } - - fmt.Fprintf(&b, `"[%s]":`, msd.name) - - x := ext.value - if x == nil { - x = reflect.New(msd.t.Elem()).Interface() - if err := Unmarshal(ext.enc, x.(Message)); err != nil { - return nil, err - } - } - d, err := json.Marshal(x) - if err != nil { - return nil, err - } - b.Write(d) - } - b.WriteByte('}') - return b.Bytes(), nil -} - -// UnmarshalMessageSetJSON decodes the extension map encoded in buf in JSON format. -// It is called by generated UnmarshalJSON methods on protocol buffer messages with the message_set_wire_format option. -func UnmarshalMessageSetJSON(buf []byte, exts interface{}) error { - // Common-case fast path. - if len(buf) == 0 || bytes.Equal(buf, []byte("{}")) { - return nil - } - - // This is fairly tricky, and it's not clear that it is needed. - return errors.New("TODO: UnmarshalMessageSetJSON not yet implemented") -} - -// A global registry of types that can be used in a MessageSet. - -var messageSetMap = make(map[int32]messageSetDesc) - -type messageSetDesc struct { - t reflect.Type // pointer to struct - name string -} - -// RegisterMessageSetType is called from the generated code. -func RegisterMessageSetType(m Message, fieldNum int32, name string) { - messageSetMap[fieldNum] = messageSetDesc{ - t: reflect.TypeOf(m), - name: name, - } -} diff --git a/vendor/github.com/golang/protobuf/proto/pointer_reflect.go b/vendor/github.com/golang/protobuf/proto/pointer_reflect.go index b6cad908..94fa9194 100644 --- a/vendor/github.com/golang/protobuf/proto/pointer_reflect.go +++ b/vendor/github.com/golang/protobuf/proto/pointer_reflect.go @@ -79,10 +79,13 @@ func toPointer(i *Message) pointer { // toAddrPointer converts an interface to a pointer that points to // the interface data. -func toAddrPointer(i *interface{}, isptr bool) pointer { +func toAddrPointer(i *interface{}, isptr, deref bool) pointer { v := reflect.ValueOf(*i) u := reflect.New(v.Type()) u.Elem().Set(v) + if deref { + u = u.Elem() + } return pointer{v: u} } diff --git a/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go b/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go index d55a335d..dbfffe07 100644 --- a/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go +++ b/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go @@ -85,16 +85,21 @@ func toPointer(i *Message) pointer { // toAddrPointer converts an interface to a pointer that points to // the interface data. -func toAddrPointer(i *interface{}, isptr bool) pointer { +func toAddrPointer(i *interface{}, isptr, deref bool) (p pointer) { // Super-tricky - read or get the address of data word of interface value. if isptr { // The interface is of pointer type, thus it is a direct interface. // The data word is the pointer data itself. We take its address. - return pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)} + p = pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)} + } else { + // The interface is not of pointer type. The data word is the pointer + // to the data. + p = pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]} } - // The interface is not of pointer type. The data word is the pointer - // to the data. - return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]} + if deref { + p.p = *(*unsafe.Pointer)(p.p) + } + return p } // valToPointer converts v to a pointer. v must be of pointer type. diff --git a/vendor/github.com/golang/protobuf/proto/properties.go b/vendor/github.com/golang/protobuf/proto/properties.go index 50b99b83..79668ff5 100644 --- a/vendor/github.com/golang/protobuf/proto/properties.go +++ b/vendor/github.com/golang/protobuf/proto/properties.go @@ -334,9 +334,6 @@ func GetProperties(t reflect.Type) *StructProperties { sprop, ok := propertiesMap[t] propertiesMu.RUnlock() if ok { - if collectStats { - stats.Chit++ - } return sprop } @@ -346,17 +343,20 @@ func GetProperties(t reflect.Type) *StructProperties { return sprop } +type ( + oneofFuncsIface interface { + XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) + } + oneofWrappersIface interface { + XXX_OneofWrappers() []interface{} + } +) + // getPropertiesLocked requires that propertiesMu is held. func getPropertiesLocked(t reflect.Type) *StructProperties { if prop, ok := propertiesMap[t]; ok { - if collectStats { - stats.Chit++ - } return prop } - if collectStats { - stats.Cmiss++ - } prop := new(StructProperties) // in case of recursive protos, fill this in now. @@ -391,13 +391,14 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { // Re-order prop.order. sort.Sort(prop) - type oneofMessage interface { - XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) + var oots []interface{} + switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { + case oneofFuncsIface: + _, _, _, oots = m.XXX_OneofFuncs() + case oneofWrappersIface: + oots = m.XXX_OneofWrappers() } - if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok { - var oots []interface{} - _, _, _, oots = om.XXX_OneofFuncs() - + if len(oots) > 0 { // Interpret oneof metadata. prop.OneofTypes = make(map[string]*OneofProperties) for _, oot := range oots { diff --git a/vendor/github.com/golang/protobuf/proto/table_marshal.go b/vendor/github.com/golang/protobuf/proto/table_marshal.go index b1679449..5cb11fa9 100644 --- a/vendor/github.com/golang/protobuf/proto/table_marshal.go +++ b/vendor/github.com/golang/protobuf/proto/table_marshal.go @@ -87,6 +87,7 @@ type marshalElemInfo struct { sizer sizer marshaler marshaler isptr bool // elem is pointer typed, thus interface of this type is a direct interface (extension only) + deref bool // dereference the pointer before operating on it; implies isptr } var ( @@ -320,8 +321,11 @@ func (u *marshalInfo) computeMarshalInfo() { // get oneof implementers var oneofImplementers []interface{} - if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok { + switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { + case oneofFuncsIface: _, _, _, oneofImplementers = m.XXX_OneofFuncs() + case oneofWrappersIface: + oneofImplementers = m.XXX_OneofWrappers() } n := t.NumField() @@ -407,13 +411,22 @@ func (u *marshalInfo) getExtElemInfo(desc *ExtensionDesc) *marshalElemInfo { panic("tag is not an integer") } wt := wiretype(tags[0]) + if t.Kind() == reflect.Ptr && t.Elem().Kind() != reflect.Struct { + t = t.Elem() + } sizer, marshaler := typeMarshaler(t, tags, false, false) + var deref bool + if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 { + t = reflect.PtrTo(t) + deref = true + } e = &marshalElemInfo{ wiretag: uint64(tag)<<3 | wt, tagsize: SizeVarint(uint64(tag) << 3), sizer: sizer, marshaler: marshaler, isptr: t.Kind() == reflect.Ptr, + deref: deref, } // update cache @@ -448,7 +461,7 @@ func (fi *marshalFieldInfo) computeMarshalFieldInfo(f *reflect.StructField) { func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofImplementers []interface{}) { fi.field = toField(f) - fi.wiretag = 1<<31 - 1 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire. + fi.wiretag = math.MaxInt32 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire. fi.isPointer = true fi.sizer, fi.marshaler = makeOneOfMarshaler(fi, f) fi.oneofElems = make(map[reflect.Type]*marshalElemInfo) @@ -476,10 +489,6 @@ func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofI } } -type oneofMessage interface { - XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) -} - // wiretype returns the wire encoding of the type. func wiretype(encoding string) uint64 { switch encoding { @@ -2310,8 +2319,8 @@ func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) { for _, k := range m.MapKeys() { ki := k.Interface() vi := m.MapIndex(k).Interface() - kaddr := toAddrPointer(&ki, false) // pointer to key - vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value + kaddr := toAddrPointer(&ki, false, false) // pointer to key + vaddr := toAddrPointer(&vi, valIsPtr, false) // pointer to value siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1) n += siz + SizeVarint(uint64(siz)) + tagsize } @@ -2329,8 +2338,8 @@ func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) { for _, k := range keys { ki := k.Interface() vi := m.MapIndex(k).Interface() - kaddr := toAddrPointer(&ki, false) // pointer to key - vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value + kaddr := toAddrPointer(&ki, false, false) // pointer to key + vaddr := toAddrPointer(&vi, valIsPtr, false) // pointer to value b = appendVarint(b, tag) siz := keySizer(kaddr, 1) + valCachedSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1) b = appendVarint(b, uint64(siz)) @@ -2399,7 +2408,7 @@ func (u *marshalInfo) sizeExtensions(ext *XXX_InternalExtensions) int { // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) n += ei.sizer(p, ei.tagsize) } mu.Unlock() @@ -2434,7 +2443,7 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err @@ -2465,7 +2474,7 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err @@ -2510,7 +2519,7 @@ func (u *marshalInfo) sizeMessageSet(ext *XXX_InternalExtensions) int { ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) n += ei.sizer(p, 1) // message, tag = 3 (size=1) } mu.Unlock() @@ -2553,7 +2562,7 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic) if !nerr.Merge(err) { return b, err @@ -2591,7 +2600,7 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic) b = append(b, 1<<3|WireEndGroup) if !nerr.Merge(err) { @@ -2621,7 +2630,7 @@ func (u *marshalInfo) sizeV1Extensions(m map[int32]Extension) int { ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) n += ei.sizer(p, ei.tagsize) } return n @@ -2656,7 +2665,7 @@ func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extension, determ ei := u.getExtElemInfo(e.desc) v := e.value - p := toAddrPointer(&v, ei.isptr) + p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err diff --git a/vendor/github.com/golang/protobuf/proto/table_unmarshal.go b/vendor/github.com/golang/protobuf/proto/table_unmarshal.go index ebf1caa5..acee2fc5 100644 --- a/vendor/github.com/golang/protobuf/proto/table_unmarshal.go +++ b/vendor/github.com/golang/protobuf/proto/table_unmarshal.go @@ -136,7 +136,7 @@ func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error { u.computeUnmarshalInfo() } if u.isMessageSet { - return UnmarshalMessageSet(b, m.offset(u.extensions).toExtensions()) + return unmarshalMessageSet(b, m.offset(u.extensions).toExtensions()) } var reqMask uint64 // bitmask of required fields we've seen. var errLater error @@ -362,46 +362,48 @@ func (u *unmarshalInfo) computeUnmarshalInfo() { } // Find any types associated with oneof fields. - // TODO: XXX_OneofFuncs returns more info than we need. Get rid of some of it? - fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("XXX_OneofFuncs") - if fn.IsValid() { - res := fn.Call(nil)[3] // last return value from XXX_OneofFuncs: []interface{} - for i := res.Len() - 1; i >= 0; i-- { - v := res.Index(i) // interface{} - tptr := reflect.ValueOf(v.Interface()).Type() // *Msg_X - typ := tptr.Elem() // Msg_X - - f := typ.Field(0) // oneof implementers have one field - baseUnmarshal := fieldUnmarshaler(&f) - tags := strings.Split(f.Tag.Get("protobuf"), ",") - fieldNum, err := strconv.Atoi(tags[1]) - if err != nil { - panic("protobuf tag field not an integer: " + tags[1]) - } - var name string - for _, tag := range tags { - if strings.HasPrefix(tag, "name=") { - name = strings.TrimPrefix(tag, "name=") - break - } + var oneofImplementers []interface{} + switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { + case oneofFuncsIface: + _, _, _, oneofImplementers = m.XXX_OneofFuncs() + case oneofWrappersIface: + oneofImplementers = m.XXX_OneofWrappers() + } + for _, v := range oneofImplementers { + tptr := reflect.TypeOf(v) // *Msg_X + typ := tptr.Elem() // Msg_X + + f := typ.Field(0) // oneof implementers have one field + baseUnmarshal := fieldUnmarshaler(&f) + tags := strings.Split(f.Tag.Get("protobuf"), ",") + fieldNum, err := strconv.Atoi(tags[1]) + if err != nil { + panic("protobuf tag field not an integer: " + tags[1]) + } + var name string + for _, tag := range tags { + if strings.HasPrefix(tag, "name=") { + name = strings.TrimPrefix(tag, "name=") + break } + } - // Find the oneof field that this struct implements. - // Might take O(n^2) to process all of the oneofs, but who cares. - for _, of := range oneofFields { - if tptr.Implements(of.ityp) { - // We have found the corresponding interface for this struct. - // That lets us know where this struct should be stored - // when we encounter it during unmarshaling. - unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal) - u.setTag(fieldNum, of.field, unmarshal, 0, name) - } + // Find the oneof field that this struct implements. + // Might take O(n^2) to process all of the oneofs, but who cares. + for _, of := range oneofFields { + if tptr.Implements(of.ityp) { + // We have found the corresponding interface for this struct. + // That lets us know where this struct should be stored + // when we encounter it during unmarshaling. + unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal) + u.setTag(fieldNum, of.field, unmarshal, 0, name) } } + } // Get extension ranges, if any. - fn = reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray") + fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray") if fn.IsValid() { if !u.extensions.IsValid() && !u.oldExtensions.IsValid() { panic("a message with extensions, but no extensions field in " + t.Name()) @@ -1948,7 +1950,7 @@ func encodeVarint(b []byte, x uint64) []byte { // If there is an error, it returns 0,0. func decodeVarint(b []byte) (uint64, int) { var x, y uint64 - if len(b) <= 0 { + if len(b) == 0 { goto bad } x = uint64(b[0]) diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go index e855b1f5..1ded05bb 100644 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go +++ b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go @@ -1,11 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/protobuf/descriptor.proto -package descriptor // import "github.com/golang/protobuf/protoc-gen-go/descriptor" +package descriptor -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -16,7 +18,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type FieldDescriptorProto_Type int32 @@ -72,6 +74,7 @@ var FieldDescriptorProto_Type_name = map[int32]string{ 17: "TYPE_SINT32", 18: "TYPE_SINT64", } + var FieldDescriptorProto_Type_value = map[string]int32{ "TYPE_DOUBLE": 1, "TYPE_FLOAT": 2, @@ -98,9 +101,11 @@ func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type { *p = x return p } + func (x FieldDescriptorProto_Type) String() string { return proto.EnumName(FieldDescriptorProto_Type_name, int32(x)) } + func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Type_value, data, "FieldDescriptorProto_Type") if err != nil { @@ -109,8 +114,9 @@ func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error { *x = FieldDescriptorProto_Type(value) return nil } + func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{4, 0} + return fileDescriptor_e5baabe45344a177, []int{4, 0} } type FieldDescriptorProto_Label int32 @@ -127,6 +133,7 @@ var FieldDescriptorProto_Label_name = map[int32]string{ 2: "LABEL_REQUIRED", 3: "LABEL_REPEATED", } + var FieldDescriptorProto_Label_value = map[string]int32{ "LABEL_OPTIONAL": 1, "LABEL_REQUIRED": 2, @@ -138,9 +145,11 @@ func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label { *p = x return p } + func (x FieldDescriptorProto_Label) String() string { return proto.EnumName(FieldDescriptorProto_Label_name, int32(x)) } + func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Label_value, data, "FieldDescriptorProto_Label") if err != nil { @@ -149,8 +158,9 @@ func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error { *x = FieldDescriptorProto_Label(value) return nil } + func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{4, 1} + return fileDescriptor_e5baabe45344a177, []int{4, 1} } // Generated classes can be optimized for speed or code size. @@ -168,6 +178,7 @@ var FileOptions_OptimizeMode_name = map[int32]string{ 2: "CODE_SIZE", 3: "LITE_RUNTIME", } + var FileOptions_OptimizeMode_value = map[string]int32{ "SPEED": 1, "CODE_SIZE": 2, @@ -179,9 +190,11 @@ func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode { *p = x return p } + func (x FileOptions_OptimizeMode) String() string { return proto.EnumName(FileOptions_OptimizeMode_name, int32(x)) } + func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FileOptions_OptimizeMode_value, data, "FileOptions_OptimizeMode") if err != nil { @@ -190,8 +203,9 @@ func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error { *x = FileOptions_OptimizeMode(value) return nil } + func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{10, 0} + return fileDescriptor_e5baabe45344a177, []int{10, 0} } type FieldOptions_CType int32 @@ -208,6 +222,7 @@ var FieldOptions_CType_name = map[int32]string{ 1: "CORD", 2: "STRING_PIECE", } + var FieldOptions_CType_value = map[string]int32{ "STRING": 0, "CORD": 1, @@ -219,9 +234,11 @@ func (x FieldOptions_CType) Enum() *FieldOptions_CType { *p = x return p } + func (x FieldOptions_CType) String() string { return proto.EnumName(FieldOptions_CType_name, int32(x)) } + func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FieldOptions_CType_value, data, "FieldOptions_CType") if err != nil { @@ -230,8 +247,9 @@ func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error { *x = FieldOptions_CType(value) return nil } + func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{12, 0} + return fileDescriptor_e5baabe45344a177, []int{12, 0} } type FieldOptions_JSType int32 @@ -250,6 +268,7 @@ var FieldOptions_JSType_name = map[int32]string{ 1: "JS_STRING", 2: "JS_NUMBER", } + var FieldOptions_JSType_value = map[string]int32{ "JS_NORMAL": 0, "JS_STRING": 1, @@ -261,9 +280,11 @@ func (x FieldOptions_JSType) Enum() *FieldOptions_JSType { *p = x return p } + func (x FieldOptions_JSType) String() string { return proto.EnumName(FieldOptions_JSType_name, int32(x)) } + func (x *FieldOptions_JSType) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FieldOptions_JSType_value, data, "FieldOptions_JSType") if err != nil { @@ -272,8 +293,9 @@ func (x *FieldOptions_JSType) UnmarshalJSON(data []byte) error { *x = FieldOptions_JSType(value) return nil } + func (FieldOptions_JSType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{12, 1} + return fileDescriptor_e5baabe45344a177, []int{12, 1} } // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, @@ -292,6 +314,7 @@ var MethodOptions_IdempotencyLevel_name = map[int32]string{ 1: "NO_SIDE_EFFECTS", 2: "IDEMPOTENT", } + var MethodOptions_IdempotencyLevel_value = map[string]int32{ "IDEMPOTENCY_UNKNOWN": 0, "NO_SIDE_EFFECTS": 1, @@ -303,9 +326,11 @@ func (x MethodOptions_IdempotencyLevel) Enum() *MethodOptions_IdempotencyLevel { *p = x return p } + func (x MethodOptions_IdempotencyLevel) String() string { return proto.EnumName(MethodOptions_IdempotencyLevel_name, int32(x)) } + func (x *MethodOptions_IdempotencyLevel) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(MethodOptions_IdempotencyLevel_value, data, "MethodOptions_IdempotencyLevel") if err != nil { @@ -314,8 +339,9 @@ func (x *MethodOptions_IdempotencyLevel) UnmarshalJSON(data []byte) error { *x = MethodOptions_IdempotencyLevel(value) return nil } + func (MethodOptions_IdempotencyLevel) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{17, 0} + return fileDescriptor_e5baabe45344a177, []int{17, 0} } // The protocol compiler can output a FileDescriptorSet containing the .proto @@ -331,16 +357,17 @@ func (m *FileDescriptorSet) Reset() { *m = FileDescriptorSet{} } func (m *FileDescriptorSet) String() string { return proto.CompactTextString(m) } func (*FileDescriptorSet) ProtoMessage() {} func (*FileDescriptorSet) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{0} + return fileDescriptor_e5baabe45344a177, []int{0} } + func (m *FileDescriptorSet) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FileDescriptorSet.Unmarshal(m, b) } func (m *FileDescriptorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FileDescriptorSet.Marshal(b, m, deterministic) } -func (dst *FileDescriptorSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileDescriptorSet.Merge(dst, src) +func (m *FileDescriptorSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileDescriptorSet.Merge(m, src) } func (m *FileDescriptorSet) XXX_Size() int { return xxx_messageInfo_FileDescriptorSet.Size(m) @@ -392,16 +419,17 @@ func (m *FileDescriptorProto) Reset() { *m = FileDescriptorProto{} } func (m *FileDescriptorProto) String() string { return proto.CompactTextString(m) } func (*FileDescriptorProto) ProtoMessage() {} func (*FileDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{1} + return fileDescriptor_e5baabe45344a177, []int{1} } + func (m *FileDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FileDescriptorProto.Unmarshal(m, b) } func (m *FileDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FileDescriptorProto.Marshal(b, m, deterministic) } -func (dst *FileDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileDescriptorProto.Merge(dst, src) +func (m *FileDescriptorProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileDescriptorProto.Merge(m, src) } func (m *FileDescriptorProto) XXX_Size() int { return xxx_messageInfo_FileDescriptorProto.Size(m) @@ -519,16 +547,17 @@ func (m *DescriptorProto) Reset() { *m = DescriptorProto{} } func (m *DescriptorProto) String() string { return proto.CompactTextString(m) } func (*DescriptorProto) ProtoMessage() {} func (*DescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{2} + return fileDescriptor_e5baabe45344a177, []int{2} } + func (m *DescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DescriptorProto.Unmarshal(m, b) } func (m *DescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DescriptorProto.Marshal(b, m, deterministic) } -func (dst *DescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescriptorProto.Merge(dst, src) +func (m *DescriptorProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_DescriptorProto.Merge(m, src) } func (m *DescriptorProto) XXX_Size() int { return xxx_messageInfo_DescriptorProto.Size(m) @@ -622,16 +651,17 @@ func (m *DescriptorProto_ExtensionRange) Reset() { *m = DescriptorProto_ func (m *DescriptorProto_ExtensionRange) String() string { return proto.CompactTextString(m) } func (*DescriptorProto_ExtensionRange) ProtoMessage() {} func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{2, 0} + return fileDescriptor_e5baabe45344a177, []int{2, 0} } + func (m *DescriptorProto_ExtensionRange) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DescriptorProto_ExtensionRange.Unmarshal(m, b) } func (m *DescriptorProto_ExtensionRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DescriptorProto_ExtensionRange.Marshal(b, m, deterministic) } -func (dst *DescriptorProto_ExtensionRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescriptorProto_ExtensionRange.Merge(dst, src) +func (m *DescriptorProto_ExtensionRange) XXX_Merge(src proto.Message) { + xxx_messageInfo_DescriptorProto_ExtensionRange.Merge(m, src) } func (m *DescriptorProto_ExtensionRange) XXX_Size() int { return xxx_messageInfo_DescriptorProto_ExtensionRange.Size(m) @@ -678,16 +708,17 @@ func (m *DescriptorProto_ReservedRange) Reset() { *m = DescriptorProto_R func (m *DescriptorProto_ReservedRange) String() string { return proto.CompactTextString(m) } func (*DescriptorProto_ReservedRange) ProtoMessage() {} func (*DescriptorProto_ReservedRange) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{2, 1} + return fileDescriptor_e5baabe45344a177, []int{2, 1} } + func (m *DescriptorProto_ReservedRange) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DescriptorProto_ReservedRange.Unmarshal(m, b) } func (m *DescriptorProto_ReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DescriptorProto_ReservedRange.Marshal(b, m, deterministic) } -func (dst *DescriptorProto_ReservedRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescriptorProto_ReservedRange.Merge(dst, src) +func (m *DescriptorProto_ReservedRange) XXX_Merge(src proto.Message) { + xxx_messageInfo_DescriptorProto_ReservedRange.Merge(m, src) } func (m *DescriptorProto_ReservedRange) XXX_Size() int { return xxx_messageInfo_DescriptorProto_ReservedRange.Size(m) @@ -725,7 +756,7 @@ func (m *ExtensionRangeOptions) Reset() { *m = ExtensionRangeOptions{} } func (m *ExtensionRangeOptions) String() string { return proto.CompactTextString(m) } func (*ExtensionRangeOptions) ProtoMessage() {} func (*ExtensionRangeOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{3} + return fileDescriptor_e5baabe45344a177, []int{3} } var extRange_ExtensionRangeOptions = []proto.ExtensionRange{ @@ -735,14 +766,15 @@ var extRange_ExtensionRangeOptions = []proto.ExtensionRange{ func (*ExtensionRangeOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_ExtensionRangeOptions } + func (m *ExtensionRangeOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ExtensionRangeOptions.Unmarshal(m, b) } func (m *ExtensionRangeOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ExtensionRangeOptions.Marshal(b, m, deterministic) } -func (dst *ExtensionRangeOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtensionRangeOptions.Merge(dst, src) +func (m *ExtensionRangeOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExtensionRangeOptions.Merge(m, src) } func (m *ExtensionRangeOptions) XXX_Size() int { return xxx_messageInfo_ExtensionRangeOptions.Size(m) @@ -801,16 +833,17 @@ func (m *FieldDescriptorProto) Reset() { *m = FieldDescriptorProto{} } func (m *FieldDescriptorProto) String() string { return proto.CompactTextString(m) } func (*FieldDescriptorProto) ProtoMessage() {} func (*FieldDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{4} + return fileDescriptor_e5baabe45344a177, []int{4} } + func (m *FieldDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FieldDescriptorProto.Unmarshal(m, b) } func (m *FieldDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FieldDescriptorProto.Marshal(b, m, deterministic) } -func (dst *FieldDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldDescriptorProto.Merge(dst, src) +func (m *FieldDescriptorProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_FieldDescriptorProto.Merge(m, src) } func (m *FieldDescriptorProto) XXX_Size() int { return xxx_messageInfo_FieldDescriptorProto.Size(m) @@ -904,16 +937,17 @@ func (m *OneofDescriptorProto) Reset() { *m = OneofDescriptorProto{} } func (m *OneofDescriptorProto) String() string { return proto.CompactTextString(m) } func (*OneofDescriptorProto) ProtoMessage() {} func (*OneofDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{5} + return fileDescriptor_e5baabe45344a177, []int{5} } + func (m *OneofDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OneofDescriptorProto.Unmarshal(m, b) } func (m *OneofDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OneofDescriptorProto.Marshal(b, m, deterministic) } -func (dst *OneofDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_OneofDescriptorProto.Merge(dst, src) +func (m *OneofDescriptorProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_OneofDescriptorProto.Merge(m, src) } func (m *OneofDescriptorProto) XXX_Size() int { return xxx_messageInfo_OneofDescriptorProto.Size(m) @@ -959,16 +993,17 @@ func (m *EnumDescriptorProto) Reset() { *m = EnumDescriptorProto{} } func (m *EnumDescriptorProto) String() string { return proto.CompactTextString(m) } func (*EnumDescriptorProto) ProtoMessage() {} func (*EnumDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{6} + return fileDescriptor_e5baabe45344a177, []int{6} } + func (m *EnumDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumDescriptorProto.Unmarshal(m, b) } func (m *EnumDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_EnumDescriptorProto.Marshal(b, m, deterministic) } -func (dst *EnumDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumDescriptorProto.Merge(dst, src) +func (m *EnumDescriptorProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnumDescriptorProto.Merge(m, src) } func (m *EnumDescriptorProto) XXX_Size() int { return xxx_messageInfo_EnumDescriptorProto.Size(m) @@ -1032,16 +1067,17 @@ func (m *EnumDescriptorProto_EnumReservedRange) Reset() { *m = EnumDescr func (m *EnumDescriptorProto_EnumReservedRange) String() string { return proto.CompactTextString(m) } func (*EnumDescriptorProto_EnumReservedRange) ProtoMessage() {} func (*EnumDescriptorProto_EnumReservedRange) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{6, 0} + return fileDescriptor_e5baabe45344a177, []int{6, 0} } + func (m *EnumDescriptorProto_EnumReservedRange) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Unmarshal(m, b) } func (m *EnumDescriptorProto_EnumReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Marshal(b, m, deterministic) } -func (dst *EnumDescriptorProto_EnumReservedRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Merge(dst, src) +func (m *EnumDescriptorProto_EnumReservedRange) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Merge(m, src) } func (m *EnumDescriptorProto_EnumReservedRange) XXX_Size() int { return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Size(m) @@ -1080,16 +1116,17 @@ func (m *EnumValueDescriptorProto) Reset() { *m = EnumValueDescriptorPro func (m *EnumValueDescriptorProto) String() string { return proto.CompactTextString(m) } func (*EnumValueDescriptorProto) ProtoMessage() {} func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{7} + return fileDescriptor_e5baabe45344a177, []int{7} } + func (m *EnumValueDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumValueDescriptorProto.Unmarshal(m, b) } func (m *EnumValueDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_EnumValueDescriptorProto.Marshal(b, m, deterministic) } -func (dst *EnumValueDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumValueDescriptorProto.Merge(dst, src) +func (m *EnumValueDescriptorProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnumValueDescriptorProto.Merge(m, src) } func (m *EnumValueDescriptorProto) XXX_Size() int { return xxx_messageInfo_EnumValueDescriptorProto.Size(m) @@ -1135,16 +1172,17 @@ func (m *ServiceDescriptorProto) Reset() { *m = ServiceDescriptorProto{} func (m *ServiceDescriptorProto) String() string { return proto.CompactTextString(m) } func (*ServiceDescriptorProto) ProtoMessage() {} func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{8} + return fileDescriptor_e5baabe45344a177, []int{8} } + func (m *ServiceDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ServiceDescriptorProto.Unmarshal(m, b) } func (m *ServiceDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ServiceDescriptorProto.Marshal(b, m, deterministic) } -func (dst *ServiceDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceDescriptorProto.Merge(dst, src) +func (m *ServiceDescriptorProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceDescriptorProto.Merge(m, src) } func (m *ServiceDescriptorProto) XXX_Size() int { return xxx_messageInfo_ServiceDescriptorProto.Size(m) @@ -1197,16 +1235,17 @@ func (m *MethodDescriptorProto) Reset() { *m = MethodDescriptorProto{} } func (m *MethodDescriptorProto) String() string { return proto.CompactTextString(m) } func (*MethodDescriptorProto) ProtoMessage() {} func (*MethodDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{9} + return fileDescriptor_e5baabe45344a177, []int{9} } + func (m *MethodDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MethodDescriptorProto.Unmarshal(m, b) } func (m *MethodDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MethodDescriptorProto.Marshal(b, m, deterministic) } -func (dst *MethodDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_MethodDescriptorProto.Merge(dst, src) +func (m *MethodDescriptorProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_MethodDescriptorProto.Merge(m, src) } func (m *MethodDescriptorProto) XXX_Size() int { return xxx_messageInfo_MethodDescriptorProto.Size(m) @@ -1336,6 +1375,14 @@ type FileOptions struct { // is empty. When this option is empty, the package name will be used for // determining the namespace. PhpNamespace *string `protobuf:"bytes,41,opt,name=php_namespace,json=phpNamespace" json:"php_namespace,omitempty"` + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be used + // for determining the namespace. + PhpMetadataNamespace *string `protobuf:"bytes,44,opt,name=php_metadata_namespace,json=phpMetadataNamespace" json:"php_metadata_namespace,omitempty"` + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + RubyPackage *string `protobuf:"bytes,45,opt,name=ruby_package,json=rubyPackage" json:"ruby_package,omitempty"` // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` @@ -1349,7 +1396,7 @@ func (m *FileOptions) Reset() { *m = FileOptions{} } func (m *FileOptions) String() string { return proto.CompactTextString(m) } func (*FileOptions) ProtoMessage() {} func (*FileOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{10} + return fileDescriptor_e5baabe45344a177, []int{10} } var extRange_FileOptions = []proto.ExtensionRange{ @@ -1359,14 +1406,15 @@ var extRange_FileOptions = []proto.ExtensionRange{ func (*FileOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_FileOptions } + func (m *FileOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FileOptions.Unmarshal(m, b) } func (m *FileOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FileOptions.Marshal(b, m, deterministic) } -func (dst *FileOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileOptions.Merge(dst, src) +func (m *FileOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileOptions.Merge(m, src) } func (m *FileOptions) XXX_Size() int { return xxx_messageInfo_FileOptions.Size(m) @@ -1514,6 +1562,20 @@ func (m *FileOptions) GetPhpNamespace() string { return "" } +func (m *FileOptions) GetPhpMetadataNamespace() string { + if m != nil && m.PhpMetadataNamespace != nil { + return *m.PhpMetadataNamespace + } + return "" +} + +func (m *FileOptions) GetRubyPackage() string { + if m != nil && m.RubyPackage != nil { + return *m.RubyPackage + } + return "" +} + func (m *FileOptions) GetUninterpretedOption() []*UninterpretedOption { if m != nil { return m.UninterpretedOption @@ -1584,7 +1646,7 @@ func (m *MessageOptions) Reset() { *m = MessageOptions{} } func (m *MessageOptions) String() string { return proto.CompactTextString(m) } func (*MessageOptions) ProtoMessage() {} func (*MessageOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{11} + return fileDescriptor_e5baabe45344a177, []int{11} } var extRange_MessageOptions = []proto.ExtensionRange{ @@ -1594,14 +1656,15 @@ var extRange_MessageOptions = []proto.ExtensionRange{ func (*MessageOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_MessageOptions } + func (m *MessageOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MessageOptions.Unmarshal(m, b) } func (m *MessageOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MessageOptions.Marshal(b, m, deterministic) } -func (dst *MessageOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageOptions.Merge(dst, src) +func (m *MessageOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageOptions.Merge(m, src) } func (m *MessageOptions) XXX_Size() int { return xxx_messageInfo_MessageOptions.Size(m) @@ -1723,7 +1786,7 @@ func (m *FieldOptions) Reset() { *m = FieldOptions{} } func (m *FieldOptions) String() string { return proto.CompactTextString(m) } func (*FieldOptions) ProtoMessage() {} func (*FieldOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{12} + return fileDescriptor_e5baabe45344a177, []int{12} } var extRange_FieldOptions = []proto.ExtensionRange{ @@ -1733,14 +1796,15 @@ var extRange_FieldOptions = []proto.ExtensionRange{ func (*FieldOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_FieldOptions } + func (m *FieldOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FieldOptions.Unmarshal(m, b) } func (m *FieldOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FieldOptions.Marshal(b, m, deterministic) } -func (dst *FieldOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldOptions.Merge(dst, src) +func (m *FieldOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_FieldOptions.Merge(m, src) } func (m *FieldOptions) XXX_Size() int { return xxx_messageInfo_FieldOptions.Size(m) @@ -1819,7 +1883,7 @@ func (m *OneofOptions) Reset() { *m = OneofOptions{} } func (m *OneofOptions) String() string { return proto.CompactTextString(m) } func (*OneofOptions) ProtoMessage() {} func (*OneofOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{13} + return fileDescriptor_e5baabe45344a177, []int{13} } var extRange_OneofOptions = []proto.ExtensionRange{ @@ -1829,14 +1893,15 @@ var extRange_OneofOptions = []proto.ExtensionRange{ func (*OneofOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_OneofOptions } + func (m *OneofOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OneofOptions.Unmarshal(m, b) } func (m *OneofOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OneofOptions.Marshal(b, m, deterministic) } -func (dst *OneofOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_OneofOptions.Merge(dst, src) +func (m *OneofOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_OneofOptions.Merge(m, src) } func (m *OneofOptions) XXX_Size() int { return xxx_messageInfo_OneofOptions.Size(m) @@ -1875,7 +1940,7 @@ func (m *EnumOptions) Reset() { *m = EnumOptions{} } func (m *EnumOptions) String() string { return proto.CompactTextString(m) } func (*EnumOptions) ProtoMessage() {} func (*EnumOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{14} + return fileDescriptor_e5baabe45344a177, []int{14} } var extRange_EnumOptions = []proto.ExtensionRange{ @@ -1885,14 +1950,15 @@ var extRange_EnumOptions = []proto.ExtensionRange{ func (*EnumOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_EnumOptions } + func (m *EnumOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumOptions.Unmarshal(m, b) } func (m *EnumOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_EnumOptions.Marshal(b, m, deterministic) } -func (dst *EnumOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumOptions.Merge(dst, src) +func (m *EnumOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnumOptions.Merge(m, src) } func (m *EnumOptions) XXX_Size() int { return xxx_messageInfo_EnumOptions.Size(m) @@ -1944,7 +2010,7 @@ func (m *EnumValueOptions) Reset() { *m = EnumValueOptions{} } func (m *EnumValueOptions) String() string { return proto.CompactTextString(m) } func (*EnumValueOptions) ProtoMessage() {} func (*EnumValueOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{15} + return fileDescriptor_e5baabe45344a177, []int{15} } var extRange_EnumValueOptions = []proto.ExtensionRange{ @@ -1954,14 +2020,15 @@ var extRange_EnumValueOptions = []proto.ExtensionRange{ func (*EnumValueOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_EnumValueOptions } + func (m *EnumValueOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumValueOptions.Unmarshal(m, b) } func (m *EnumValueOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_EnumValueOptions.Marshal(b, m, deterministic) } -func (dst *EnumValueOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumValueOptions.Merge(dst, src) +func (m *EnumValueOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnumValueOptions.Merge(m, src) } func (m *EnumValueOptions) XXX_Size() int { return xxx_messageInfo_EnumValueOptions.Size(m) @@ -2006,7 +2073,7 @@ func (m *ServiceOptions) Reset() { *m = ServiceOptions{} } func (m *ServiceOptions) String() string { return proto.CompactTextString(m) } func (*ServiceOptions) ProtoMessage() {} func (*ServiceOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{16} + return fileDescriptor_e5baabe45344a177, []int{16} } var extRange_ServiceOptions = []proto.ExtensionRange{ @@ -2016,14 +2083,15 @@ var extRange_ServiceOptions = []proto.ExtensionRange{ func (*ServiceOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_ServiceOptions } + func (m *ServiceOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ServiceOptions.Unmarshal(m, b) } func (m *ServiceOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ServiceOptions.Marshal(b, m, deterministic) } -func (dst *ServiceOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceOptions.Merge(dst, src) +func (m *ServiceOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceOptions.Merge(m, src) } func (m *ServiceOptions) XXX_Size() int { return xxx_messageInfo_ServiceOptions.Size(m) @@ -2069,7 +2137,7 @@ func (m *MethodOptions) Reset() { *m = MethodOptions{} } func (m *MethodOptions) String() string { return proto.CompactTextString(m) } func (*MethodOptions) ProtoMessage() {} func (*MethodOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{17} + return fileDescriptor_e5baabe45344a177, []int{17} } var extRange_MethodOptions = []proto.ExtensionRange{ @@ -2079,14 +2147,15 @@ var extRange_MethodOptions = []proto.ExtensionRange{ func (*MethodOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_MethodOptions } + func (m *MethodOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MethodOptions.Unmarshal(m, b) } func (m *MethodOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MethodOptions.Marshal(b, m, deterministic) } -func (dst *MethodOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_MethodOptions.Merge(dst, src) +func (m *MethodOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_MethodOptions.Merge(m, src) } func (m *MethodOptions) XXX_Size() int { return xxx_messageInfo_MethodOptions.Size(m) @@ -2146,16 +2215,17 @@ func (m *UninterpretedOption) Reset() { *m = UninterpretedOption{} } func (m *UninterpretedOption) String() string { return proto.CompactTextString(m) } func (*UninterpretedOption) ProtoMessage() {} func (*UninterpretedOption) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{18} + return fileDescriptor_e5baabe45344a177, []int{18} } + func (m *UninterpretedOption) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UninterpretedOption.Unmarshal(m, b) } func (m *UninterpretedOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UninterpretedOption.Marshal(b, m, deterministic) } -func (dst *UninterpretedOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_UninterpretedOption.Merge(dst, src) +func (m *UninterpretedOption) XXX_Merge(src proto.Message) { + xxx_messageInfo_UninterpretedOption.Merge(m, src) } func (m *UninterpretedOption) XXX_Size() int { return xxx_messageInfo_UninterpretedOption.Size(m) @@ -2232,16 +2302,17 @@ func (m *UninterpretedOption_NamePart) Reset() { *m = UninterpretedOptio func (m *UninterpretedOption_NamePart) String() string { return proto.CompactTextString(m) } func (*UninterpretedOption_NamePart) ProtoMessage() {} func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{18, 0} + return fileDescriptor_e5baabe45344a177, []int{18, 0} } + func (m *UninterpretedOption_NamePart) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UninterpretedOption_NamePart.Unmarshal(m, b) } func (m *UninterpretedOption_NamePart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UninterpretedOption_NamePart.Marshal(b, m, deterministic) } -func (dst *UninterpretedOption_NamePart) XXX_Merge(src proto.Message) { - xxx_messageInfo_UninterpretedOption_NamePart.Merge(dst, src) +func (m *UninterpretedOption_NamePart) XXX_Merge(src proto.Message) { + xxx_messageInfo_UninterpretedOption_NamePart.Merge(m, src) } func (m *UninterpretedOption_NamePart) XXX_Size() int { return xxx_messageInfo_UninterpretedOption_NamePart.Size(m) @@ -2322,16 +2393,17 @@ func (m *SourceCodeInfo) Reset() { *m = SourceCodeInfo{} } func (m *SourceCodeInfo) String() string { return proto.CompactTextString(m) } func (*SourceCodeInfo) ProtoMessage() {} func (*SourceCodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{19} + return fileDescriptor_e5baabe45344a177, []int{19} } + func (m *SourceCodeInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SourceCodeInfo.Unmarshal(m, b) } func (m *SourceCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SourceCodeInfo.Marshal(b, m, deterministic) } -func (dst *SourceCodeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_SourceCodeInfo.Merge(dst, src) +func (m *SourceCodeInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SourceCodeInfo.Merge(m, src) } func (m *SourceCodeInfo) XXX_Size() int { return xxx_messageInfo_SourceCodeInfo.Size(m) @@ -2439,16 +2511,17 @@ func (m *SourceCodeInfo_Location) Reset() { *m = SourceCodeInfo_Location func (m *SourceCodeInfo_Location) String() string { return proto.CompactTextString(m) } func (*SourceCodeInfo_Location) ProtoMessage() {} func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{19, 0} + return fileDescriptor_e5baabe45344a177, []int{19, 0} } + func (m *SourceCodeInfo_Location) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SourceCodeInfo_Location.Unmarshal(m, b) } func (m *SourceCodeInfo_Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SourceCodeInfo_Location.Marshal(b, m, deterministic) } -func (dst *SourceCodeInfo_Location) XXX_Merge(src proto.Message) { - xxx_messageInfo_SourceCodeInfo_Location.Merge(dst, src) +func (m *SourceCodeInfo_Location) XXX_Merge(src proto.Message) { + xxx_messageInfo_SourceCodeInfo_Location.Merge(m, src) } func (m *SourceCodeInfo_Location) XXX_Size() int { return xxx_messageInfo_SourceCodeInfo_Location.Size(m) @@ -2510,16 +2583,17 @@ func (m *GeneratedCodeInfo) Reset() { *m = GeneratedCodeInfo{} } func (m *GeneratedCodeInfo) String() string { return proto.CompactTextString(m) } func (*GeneratedCodeInfo) ProtoMessage() {} func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{20} + return fileDescriptor_e5baabe45344a177, []int{20} } + func (m *GeneratedCodeInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GeneratedCodeInfo.Unmarshal(m, b) } func (m *GeneratedCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GeneratedCodeInfo.Marshal(b, m, deterministic) } -func (dst *GeneratedCodeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_GeneratedCodeInfo.Merge(dst, src) +func (m *GeneratedCodeInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_GeneratedCodeInfo.Merge(m, src) } func (m *GeneratedCodeInfo) XXX_Size() int { return xxx_messageInfo_GeneratedCodeInfo.Size(m) @@ -2559,16 +2633,17 @@ func (m *GeneratedCodeInfo_Annotation) Reset() { *m = GeneratedCodeInfo_ func (m *GeneratedCodeInfo_Annotation) String() string { return proto.CompactTextString(m) } func (*GeneratedCodeInfo_Annotation) ProtoMessage() {} func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{20, 0} + return fileDescriptor_e5baabe45344a177, []int{20, 0} } + func (m *GeneratedCodeInfo_Annotation) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GeneratedCodeInfo_Annotation.Unmarshal(m, b) } func (m *GeneratedCodeInfo_Annotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GeneratedCodeInfo_Annotation.Marshal(b, m, deterministic) } -func (dst *GeneratedCodeInfo_Annotation) XXX_Merge(src proto.Message) { - xxx_messageInfo_GeneratedCodeInfo_Annotation.Merge(dst, src) +func (m *GeneratedCodeInfo_Annotation) XXX_Merge(src proto.Message) { + xxx_messageInfo_GeneratedCodeInfo_Annotation.Merge(m, src) } func (m *GeneratedCodeInfo_Annotation) XXX_Size() int { return xxx_messageInfo_GeneratedCodeInfo_Annotation.Size(m) @@ -2608,6 +2683,12 @@ func (m *GeneratedCodeInfo_Annotation) GetEnd() int32 { } func init() { + proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value) + proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value) + proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value) + proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value) + proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value) + proto.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value) proto.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet") proto.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto") proto.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto") @@ -2635,178 +2716,172 @@ func init() { proto.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location") proto.RegisterType((*GeneratedCodeInfo)(nil), "google.protobuf.GeneratedCodeInfo") proto.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation") - proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value) - proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value) - proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value) - proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value) - proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value) - proto.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value) } -func init() { - proto.RegisterFile("google/protobuf/descriptor.proto", fileDescriptor_descriptor_4df4cb5f42392df6) -} - -var fileDescriptor_descriptor_4df4cb5f42392df6 = []byte{ - // 2555 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xdd, 0x6e, 0x1b, 0xc7, - 0xf5, 0xc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0x03, 0xa2, 0x8f, 0xa9, - 0x31, 0x13, 0x2a, 0xf0, 0x47, 0x88, 0xcb, 0x21, 0xa1, 0x15, 0xf6, 0x47, 0xb2, 0xb5, 0x6f, 0x24, - 0x58, 0x8f, 0xae, 0x53, 0x46, 0xec, 0xac, 0x63, 0x00, 0x62, 0xdb, 0x4e, 0x90, 0x74, 0xd7, 0x62, - 0x28, 0x2f, 0xc8, 0xd5, 0x1b, 0xb1, 0x90, 0x9a, 0x50, 0xb0, 0x35, 0x01, 0x98, 0xf5, 0x9c, 0xeb, - 0xb6, 0xab, 0x50, 0x0e, 0x3f, 0xf0, 0xf0, 0xaf, 0x84, 0xe2, 0x02, 0x0e, 0x02, 0x62, 0xf7, 0x2e, - 0xbc, 0x09, 0xf9, 0x53, 0x3a, 0x32, 0xed, 0xf0, 0xd9, 0x56, 0x34, 0xa2, 0x67, 0x92, 0x5c, 0xfc, - 0x4c, 0xb2, 0xff, 0x5b, 0x09, 0x36, 0x74, 0x67, 0x32, 0x6f, 0xef, 0x3e, 0x9a, 0x7b, 0x05, 0xf0, - 0x3f, 0x96, 0x3e, 0xff, 0x68, 0x64, 0x06, 0xe3, 0xe9, 0x69, 0x5d, 0x77, 0x26, 0xbb, 0x23, 0xc7, - 0x22, 0xf6, 0x68, 0xf6, 0x99, 0x93, 0xff, 0xd1, 0xdf, 0x1d, 0x51, 0xfb, 0xdd, 0x91, 0x93, 0xf8, - 0xe8, 0x79, 0x7f, 0xf6, 0xf7, 0xbf, 0x92, 0xf4, 0xa7, 0x4c, 0xf6, 0xa0, 0xb7, 0xff, 0xe7, 0xcc, - 0xd6, 0x81, 0x18, 0xae, 0x17, 0xb9, 0x47, 0xa5, 0x43, 0x8b, 0xea, 0x6c, 0xca, 0xff, 0x0b, 0x00, - 0x00, 0xff, 0xff, 0x1a, 0x28, 0x25, 0x79, 0x42, 0x1d, 0x00, 0x00, +func init() { proto.RegisterFile("google/protobuf/descriptor.proto", fileDescriptor_e5baabe45344a177) } + +var fileDescriptor_e5baabe45344a177 = []byte{ + // 2589 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xdd, 0x8e, 0xdb, 0xc6, + 0x15, 0x0e, 0xf5, 0xb7, 0xd2, 0x91, 0x56, 0x3b, 0x3b, 0xbb, 0xb1, 0xe9, 0xcd, 0x8f, 0xd7, 0xca, + 0x8f, 0xd7, 0x4e, 0xac, 0x0d, 0x1c, 0xdb, 0x71, 0xd6, 0x45, 0x5a, 0xad, 0x44, 0x6f, 0xe4, 0xee, + 0x4a, 0x2a, 0xa5, 0x6d, 0x7e, 0x80, 0x82, 0x98, 0x25, 0x47, 0x12, 0x6d, 0x8a, 0x64, 0x48, 0xca, + 0xf6, 0x06, 0xbd, 0x30, 0xd0, 0xab, 0x5e, 0x15, 0xe8, 0x55, 0x51, 0x14, 0xbd, 0xe8, 0x4d, 0x80, + 0x3e, 0x40, 0x81, 0xde, 0xf5, 0x09, 0x0a, 0xe4, 0x0d, 0x8a, 0xb6, 0x40, 0xfb, 0x08, 0xbd, 0x2c, + 0x66, 0x86, 0xa4, 0x48, 0x49, 0x1b, 0x6f, 0x02, 0xc4, 0xb9, 0x92, 0xe6, 0x3b, 0xdf, 0x39, 0x73, + 0xe6, 0xcc, 0x99, 0x99, 0x33, 0x43, 0xd8, 0x1e, 0x39, 0xce, 0xc8, 0xa2, 0xbb, 0xae, 0xe7, 0x04, + 0xce, 0xc9, 0x74, 0xb8, 0x6b, 0x50, 0x5f, 0xf7, 0x4c, 0x37, 0x70, 0xbc, 0x3a, 0xc7, 0xf0, 0x9a, + 0x60, 0xd4, 0x23, 0x46, 0xed, 0x08, 0xd6, 0xef, 0x9b, 0x16, 0x6d, 0xc5, 0xc4, 0x3e, 0x0d, 0xf0, + 0x5d, 0xc8, 0x0d, 0x4d, 0x8b, 0xca, 0xd2, 0x76, 0x76, 0xa7, 0x7c, 0xf3, 0xcd,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f, 0xe5, 0x7f, 0xf4, 0x1b, 0x23, 0x6a, 0xdf, 0x18, 0x39, + 0x89, 0xaf, 0xa9, 0xf7, 0x66, 0x7f, 0xff, 0x27, 0x49, 0x7f, 0xca, 0x64, 0x0f, 0x7a, 0xfb, 0x7f, + 0xce, 0x6c, 0x1d, 0x88, 0xee, 0x7a, 0x51, 0x78, 0x54, 0x3a, 0xb4, 0xa8, 0xce, 0x86, 0xfc, 0xff, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xe8, 0xef, 0xc4, 0x9b, 0x1d, 0x00, 0x00, } diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto index 8697a50d..ed08fcbc 100644 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto +++ b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto @@ -417,6 +417,17 @@ message FileOptions { // determining the namespace. optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be used + // for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. repeated UninterpretedOption uninterpreted_option = 999; diff --git a/vendor/github.com/matterbridge/go-whatsapp/.gitignore b/vendor/github.com/matterbridge/go-whatsapp/.gitignore deleted file mode 100644 index 5c2e8752..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.idea/ -docs/ diff --git a/vendor/github.com/matterbridge/go-whatsapp/LICENSE b/vendor/github.com/matterbridge/go-whatsapp/LICENSE deleted file mode 100644 index b442934b..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/matterbridge/go-whatsapp/README.md b/vendor/github.com/matterbridge/go-whatsapp/README.md deleted file mode 100644 index 9a5216e7..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# go-whatsapp -Package rhymen/go-whatsapp implements the WhatsApp Web API to provide a clean interface for developers. Big thanks to all contributors of the [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng) project. The official WhatsApp Business API was released in August 2018. You can check it out [here](https://www.whatsapp.com/business/api). - -## Installation -```sh -go get github.com/rhymen/go-whatsapp -``` - -## Usage -### Creating a connection -```go -import ( - whatsapp "github.com/Rhymen/go-whatsapp" -) - -wac, err := whatsapp.NewConn(20 * time.Second) -``` -The duration passed to the NewConn function is used to timeout login requests. If you have a bad internet connection use a higher timeout value. This function only creates a websocket connection, it does not handle authentication. - -### Login -```go -qrChan := make(chan string) -go func() { - fmt.Printf("qr code: %v\n", <-qrChan) - //show qr code or save it somewhere to scan -} -sess, err := wac.Login(qrChan) -``` -The authentication process requires you to scan the qr code, that is send through the channel, with the device you are using whatsapp on. The session struct that is returned can be saved and used to restore the login without scanning the qr code again. The qr code has a ttl of 20 seconds and the login function throws a timeout err if the time has passed or any other request fails. - -### Restore -```go -newSess, err := wac.RestoreSession(sess) -``` -The restore function needs a valid session and returns the new session that was created. - -### Add message handlers -```go -type myHandler struct{} - -func (myHandler) HandleError(err error) { - fmt.Fprintf(os.Stderr, "%v", err) -} - -func (myHandler) HandleTextMessage(message whatsapp.TextMessage) { - fmt.Println(message) -} - -func (myHandler) HandleImageMessage(message whatsapp.ImageMessage) { - fmt.Println(message) -} - -func (myHandler) HandleVideoMessage(message whatsapp.VideoMessage) { - fmt.Println(message) -} - -func (myHandler) HandleJsonMessage(message string) { - fmt.Println(message) -} - -wac.AddHandler(myHandler{}) -``` -The message handlers are all optional, you don't need to implement anything but the error handler to implement the interface. The ImageMessage and VideoMessage provide a Download function to get the media data. - -### Sending text messages -```go -text := whatsapp.TextMessage{ - Info: whatsapp.MessageInfo{ - RemoteJid: "0123456789@s.whatsapp.net", - }, - Text: "Hello Whatsapp", -} - -err := wac.Send(text) -``` -The message will be send over the websocket. The attributes seen above are the required ones. All other relevant attributes (id, timestamp, fromMe, status) are set if they are missing in the struct. For the time being we only support text messages, but other types are planned for the near future. - -## Legal -This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by WhatsApp or any of its -affiliates or subsidiaries. This is an independent and unofficial software. Use at your own risk. - -## License - -The MIT License (MIT) - -Copyright (c) 2018 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/matterbridge/go-whatsapp/binary/decoder.go b/vendor/github.com/matterbridge/go-whatsapp/binary/decoder.go deleted file mode 100644 index 2ca828d0..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/binary/decoder.go +++ /dev/null @@ -1,388 +0,0 @@ -package binary - -import ( - "fmt" - "github.com/matterbridge/go-whatsapp/binary/token" - "io" - "strconv" -) - -type binaryDecoder struct { - data []byte - index int -} - -func NewDecoder(data []byte) *binaryDecoder { - return &binaryDecoder{data, 0} -} - -func (r *binaryDecoder) checkEOS(length int) error { - if r.index+length > len(r.data) { - return io.EOF - } - - return nil -} - -func (r *binaryDecoder) readByte() (byte, error) { - if err := r.checkEOS(1); err != nil { - return 0, err - } - - b := r.data[r.index] - r.index++ - - return b, nil -} - -func (r *binaryDecoder) readIntN(n int, littleEndian bool) (int, error) { - if err := r.checkEOS(n); err != nil { - return 0, err - } - - var ret int - - for i := 0; i < n; i++ { - var curShift int - if littleEndian { - curShift = i - } else { - curShift = n - i - 1 - } - ret |= int(r.data[r.index+i]) << uint(curShift*8) - } - - r.index += n - return ret, nil -} - -func (r *binaryDecoder) readInt8(littleEndian bool) (int, error) { - return r.readIntN(1, littleEndian) -} - -func (r *binaryDecoder) readInt16(littleEndian bool) (int, error) { - return r.readIntN(2, littleEndian) -} - -func (r *binaryDecoder) readInt20() (int, error) { - if err := r.checkEOS(3); err != nil { - return 0, err - } - - ret := ((int(r.data[r.index]) & 15) << 16) + (int(r.data[r.index+1]) << 8) + int(r.data[r.index+2]) - r.index += 3 - return ret, nil -} - -func (r *binaryDecoder) readInt32(littleEndian bool) (int, error) { - return r.readIntN(4, littleEndian) -} - -func (r *binaryDecoder) readInt64(littleEndian bool) (int, error) { - return r.readIntN(8, littleEndian) -} - -func (r *binaryDecoder) readPacked8(tag int) (string, error) { - startByte, err := r.readByte() - if err != nil { - return "", err - } - - ret := "" - - for i := 0; i < int(startByte&127); i++ { - currByte, err := r.readByte() - if err != nil { - return "", err - } - - lower, err := unpackByte(tag, currByte&0xF0>>4) - if err != nil { - return "", err - } - - upper, err := unpackByte(tag, currByte&0x0F) - if err != nil { - return "", err - } - - ret += lower + upper - } - - if startByte>>7 != 0 { - ret = ret[:len(ret)-1] - } - return ret, nil -} - -func unpackByte(tag int, value byte) (string, error) { - switch tag { - case token.NIBBLE_8: - return unpackNibble(value) - case token.HEX_8: - return unpackHex(value) - default: - return "", fmt.Errorf("unpackByte with unknown tag %d", tag) - } -} - -func unpackNibble(value byte) (string, error) { - switch { - case value < 0 || value > 15: - return "", fmt.Errorf("unpackNibble with value %d", value) - case value == 10: - return "-", nil - case value == 11: - return ".", nil - case value == 15: - return "\x00", nil - default: - return strconv.Itoa(int(value)), nil - } -} - -func unpackHex(value byte) (string, error) { - switch { - case value < 0 || value > 15: - return "", fmt.Errorf("unpackHex with value %d", value) - case value < 10: - return strconv.Itoa(int(value)), nil - default: - return string('A' + value - 10), nil - } -} - -func (r *binaryDecoder) readListSize(tag int) (int, error) { - switch tag { - case token.LIST_EMPTY: - return 0, nil - case token.LIST_8: - return r.readInt8(false) - case token.LIST_16: - return r.readInt16(false) - default: - return 0, fmt.Errorf("readListSize with unknown tag %d at position %d", tag, r.index) - } -} - -func (r *binaryDecoder) readString(tag int) (string, error) { - switch { - case tag >= 3 && tag <= len(token.SingleByteTokens): - tok, err := token.GetSingleToken(tag) - if err != nil { - return "", err - } - - if tok == "s.whatsapp.net" { - tok = "c.us" - } - - return tok, nil - case tag == token.DICTIONARY_0 || tag == token.DICTIONARY_1 || tag == token.DICTIONARY_2 || tag == token.DICTIONARY_3: - i, err := r.readInt8(false) - if err != nil { - return "", err - } - - return token.GetDoubleToken(tag-token.DICTIONARY_0, i) - case tag == token.LIST_EMPTY: - return "", nil - case tag == token.BINARY_8: - length, err := r.readInt8(false) - if err != nil { - return "", err - } - - return r.readStringFromChars(length) - case tag == token.BINARY_20: - length, err := r.readInt20() - if err != nil { - return "", err - } - - return r.readStringFromChars(length) - case tag == token.BINARY_32: - length, err := r.readInt32(false) - if err != nil { - return "", err - } - - return r.readStringFromChars(length) - case tag == token.JID_PAIR: - b, err := r.readByte() - if err != nil { - return "", err - } - i, err := r.readString(int(b)) - if err != nil { - return "", err - } - - b, err = r.readByte() - if err != nil { - return "", err - } - j, err := r.readString(int(b)) - if err != nil { - return "", err - } - - if i == "" || j == "" { - return "", fmt.Errorf("invalid jid pair: %s - %s", i, j) - } - - return i + "@" + j, nil - case tag == token.NIBBLE_8 || tag == token.HEX_8: - return r.readPacked8(tag) - default: - return "", fmt.Errorf("invalid string with tag %d", tag) - } -} - -func (r *binaryDecoder) readStringFromChars(length int) (string, error) { - if err := r.checkEOS(length); err != nil { - return "", err - } - - ret := r.data[r.index : r.index+length] - r.index += length - - return string(ret), nil -} - -func (r *binaryDecoder) readAttributes(n int) (map[string]string, error) { - if n == 0 { - return nil, nil - } - - ret := make(map[string]string) - for i := 0; i < n; i++ { - idx, err := r.readInt8(false) - if err != nil { - return nil, err - } - - index, err := r.readString(idx) - if err != nil { - return nil, err - } - - idx, err = r.readInt8(false) - if err != nil { - return nil, err - } - - ret[index], err = r.readString(idx) - if err != nil { - return nil, err - } - } - - return ret, nil -} - -func (r *binaryDecoder) readList(tag int) ([]Node, error) { - size, err := r.readListSize(tag) - if err != nil { - return nil, err - } - - ret := make([]Node, size) - for i := 0; i < size; i++ { - n, err := r.ReadNode() - - if err != nil { - return nil, err - } - - ret[i] = *n - } - - return ret, nil -} - -func (r *binaryDecoder) ReadNode() (*Node, error) { - ret := &Node{} - - size, err := r.readInt8(false) - if err != nil { - return nil, err - } - listSize, err := r.readListSize(size) - if err != nil { - return nil, err - } - - descrTag, err := r.readInt8(false) - if descrTag == token.STREAM_END { - return nil, fmt.Errorf("unexpected stream end") - } - ret.Description, err = r.readString(descrTag) - if err != nil { - return nil, err - } - if listSize == 0 || ret.Description == "" { - return nil, fmt.Errorf("invalid Node") - } - - ret.Attributes, err = r.readAttributes((listSize - 1) >> 1) - if err != nil { - return nil, err - } - - if listSize%2 == 1 { - return ret, nil - } - - tag, err := r.readInt8(false) - if err != nil { - return nil, err - } - - switch tag { - case token.LIST_EMPTY, token.LIST_8, token.LIST_16: - ret.Content, err = r.readList(tag) - case token.BINARY_8: - size, err = r.readInt8(false) - if err != nil { - return nil, err - } - - ret.Content, err = r.readBytes(size) - case token.BINARY_20: - size, err = r.readInt20() - if err != nil { - return nil, err - } - - ret.Content, err = r.readBytes(size) - case token.BINARY_32: - size, err = r.readInt32(false) - if err != nil { - return nil, err - } - - ret.Content, err = r.readBytes(size) - default: - ret.Content, err = r.readString(tag) - } - - if err != nil { - return nil, err - } - return ret, nil -} - -func (r *binaryDecoder) readBytes(n int) ([]byte, error) { - ret := make([]byte, n) - var err error - - for i := range ret { - ret[i], err = r.readByte() - if err != nil { - return nil, err - } - } - - return ret, nil -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/binary/encoder.go b/vendor/github.com/matterbridge/go-whatsapp/binary/encoder.go deleted file mode 100644 index a8ff1c75..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/binary/encoder.go +++ /dev/null @@ -1,351 +0,0 @@ -package binary - -import ( - "fmt" - "github.com/matterbridge/go-whatsapp/binary/token" - "math" - "strconv" - "strings" -) - -type binaryEncoder struct { - data []byte -} - -func NewEncoder() *binaryEncoder { - return &binaryEncoder{make([]byte, 0)} -} - -func (w *binaryEncoder) GetData() []byte { - return w.data -} - -func (w *binaryEncoder) pushByte(b byte) { - w.data = append(w.data, b) -} - -func (w *binaryEncoder) pushBytes(bytes []byte) { - w.data = append(w.data, bytes...) -} - -func (w *binaryEncoder) pushIntN(value, n int, littleEndian bool) { - for i := 0; i < n; i++ { - var curShift int - if littleEndian { - curShift = i - } else { - curShift = n - i - 1 - } - w.pushByte(byte((value >> uint(curShift*8)) & 0xFF)) - } -} - -func (w *binaryEncoder) pushInt20(value int) { - w.pushBytes([]byte{byte((value >> 16) & 0x0F), byte((value >> 8) & 0xFF), byte(value & 0xFF)}) -} - -func (w *binaryEncoder) pushInt8(value int) { - w.pushIntN(value, 1, false) -} - -func (w *binaryEncoder) pushInt16(value int) { - w.pushIntN(value, 2, false) -} - -func (w *binaryEncoder) pushInt32(value int) { - w.pushIntN(value, 4, false) -} - -func (w *binaryEncoder) pushInt64(value int) { - w.pushIntN(value, 8, false) -} - -func (w *binaryEncoder) pushString(value string) { - w.pushBytes([]byte(value)) -} - -func (w *binaryEncoder) writeByteLength(length int) error { - if length > math.MaxInt32 { - return fmt.Errorf("length is too large: %d", length) - } else if length >= (1 << 20) { - w.pushByte(token.BINARY_32) - w.pushInt32(length) - } else if length >= 256 { - w.pushByte(token.BINARY_20) - w.pushInt20(length) - } else { - w.pushByte(token.BINARY_8) - w.pushInt8(length) - } - - return nil -} - -func (w *binaryEncoder) WriteNode(n Node) error { - numAttributes := 0 - if n.Attributes != nil { - numAttributes = len(n.Attributes) - } - - hasContent := 0 - if n.Content != nil { - hasContent = 1 - } - - w.writeListStart(2*numAttributes + 1 + hasContent) - if err := w.writeString(n.Description, false); err != nil { - return err - } - - if err := w.writeAttributes(n.Attributes); err != nil { - return err - } - - if err := w.writeChildren(n.Content); err != nil { - return err - } - - return nil -} - -func (w *binaryEncoder) writeString(tok string, i bool) error { - if !i && tok == "c.us" { - if err := w.writeToken(token.IndexOfSingleToken("s.whatsapp.net")); err != nil { - return err - } - return nil - } - - tokenIndex := token.IndexOfSingleToken(tok) - if tokenIndex == -1 { - jidSepIndex := strings.Index(tok, "@") - if jidSepIndex < 1 { - w.writeStringRaw(tok) - } else { - w.writeJid(tok[:jidSepIndex], tok[jidSepIndex+1:]) - } - } else { - if tokenIndex < token.SINGLE_BYTE_MAX { - if err := w.writeToken(tokenIndex); err != nil { - return err - } - } else { - singleByteOverflow := tokenIndex - token.SINGLE_BYTE_MAX - dictionaryIndex := singleByteOverflow >> 8 - if dictionaryIndex < 0 || dictionaryIndex > 3 { - return fmt.Errorf("double byte dictionary token out of range: %v", tok) - } - if err := w.writeToken(token.DICTIONARY_0 + dictionaryIndex); err != nil { - return err - } - if err := w.writeToken(singleByteOverflow % 256); err != nil { - return err - } - } - } - - return nil -} - -func (w *binaryEncoder) writeStringRaw(value string) error { - if err := w.writeByteLength(len(value)); err != nil { - return err - } - - w.pushString(value) - - return nil -} - -func (w *binaryEncoder) writeJid(jidLeft, jidRight string) error { - w.pushByte(token.JID_PAIR) - - if jidLeft != "" { - if err := w.writePackedBytes(jidLeft); err != nil { - return err - } - } else { - if err := w.writeToken(token.LIST_EMPTY); err != nil { - return err - } - } - - if err := w.writeString(jidRight, false); err != nil { - return err - } - - return nil -} - -func (w *binaryEncoder) writeToken(tok int) error { - if tok < len(token.SingleByteTokens) { - w.pushByte(byte(tok)) - } else if tok <= 500 { - return fmt.Errorf("invalid token: %d", tok) - } - - return nil -} - -func (w *binaryEncoder) writeAttributes(attributes map[string]string) error { - if attributes == nil { - return nil - } - - for key, val := range attributes { - if val == "" { - continue - } - - if err := w.writeString(key, false); err != nil { - return err - } - - if err := w.writeString(val, false); err != nil { - return err - } - } - - return nil -} - -func (w *binaryEncoder) writeChildren(children interface{}) error { - if children == nil { - return nil - } - - switch childs := children.(type) { - case string: - if err := w.writeString(childs, true); err != nil { - return err - } - case []byte: - if err := w.writeByteLength(len(childs)); err != nil { - return err - } - - w.pushBytes(childs) - case []Node: - w.writeListStart(len(childs)) - for _, n := range childs { - if err := w.WriteNode(n); err != nil { - return err - } - } - default: - return fmt.Errorf("cannot write child of type: %T", children) - } - - return nil -} - -func (w *binaryEncoder) writeListStart(listSize int) { - if listSize == 0 { - w.pushByte(byte(token.LIST_EMPTY)) - } else if listSize < 256 { - w.pushByte(byte(token.LIST_8)) - w.pushInt8(listSize) - } else { - w.pushByte(byte(token.LIST_16)) - w.pushInt16(listSize) - } -} - -func (w *binaryEncoder) writePackedBytes(value string) error { - if err := w.writePackedBytesImpl(value, token.NIBBLE_8); err != nil { - if err := w.writePackedBytesImpl(value, token.HEX_8); err != nil { - return err - } - } - - return nil -} - -func (w *binaryEncoder) writePackedBytesImpl(value string, dataType int) error { - numBytes := len(value) - if numBytes > token.PACKED_MAX { - return fmt.Errorf("too many bytes to pack: %d", numBytes) - } - - w.pushByte(byte(dataType)) - - x := 0 - if numBytes%2 != 0 { - x = 128 - } - w.pushByte(byte(x | int(math.Ceil(float64(numBytes)/2.0)))) - for i, l := 0, numBytes/2; i < l; i++ { - b, err := w.packBytePair(dataType, value[2*i:2*i+1], value[2*i+1:2*i+2]) - if err != nil { - return err - } - - w.pushByte(byte(b)) - } - - if (numBytes % 2) != 0 { - b, err := w.packBytePair(dataType, value[numBytes-1:], "\x00") - if err != nil { - return err - } - - w.pushByte(byte(b)) - } - - return nil -} - -func (w *binaryEncoder) packBytePair(packType int, part1, part2 string) (int, error) { - if packType == token.NIBBLE_8 { - n1, err := packNibble(part1) - if err != nil { - return 0, err - } - - n2, err := packNibble(part2) - if err != nil { - return 0, err - } - - return (n1 << 4) | n2, nil - } else if packType == token.HEX_8 { - n1, err := packHex(part1) - if err != nil { - return 0, err - } - - n2, err := packHex(part2) - if err != nil { - return 0, err - } - - return (n1 << 4) | n2, nil - } else { - return 0, fmt.Errorf("invalid pack type (%d) for byte pair: %s / %s", packType, part1, part2) - } -} - -func packNibble(value string) (int, error) { - if value >= "0" && value <= "9" { - return strconv.Atoi(value) - } else if value == "-" { - return 10, nil - } else if value == "." { - return 11, nil - } else if value == "\x00" { - return 15, nil - } - - return 0, fmt.Errorf("invalid string to pack as nibble: %v", value) -} - -func packHex(value string) (int, error) { - if (value >= "0" && value <= "9") || (value >= "A" && value <= "F") || (value >= "a" && value <= "f") { - d, err := strconv.ParseInt(value, 16, 0) - return int(d), err - } else if value == "\x00" { - return 15, nil - } - - return 0, fmt.Errorf("invalid string to pack as hex: %v", value) -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/binary/node.go b/vendor/github.com/matterbridge/go-whatsapp/binary/node.go deleted file mode 100644 index 0e55656e..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/binary/node.go +++ /dev/null @@ -1,103 +0,0 @@ -package binary - -import ( - "fmt" - pb "github.com/matterbridge/go-whatsapp/binary/proto" - "github.com/golang/protobuf/proto" -) - -type Node struct { - Description string - Attributes map[string]string - Content interface{} -} - -func Marshal(n Node) ([]byte, error) { - if n.Attributes != nil && n.Content != nil { - a, err := marshalMessageArray(n.Content.([]interface{})) - if err != nil { - return nil, err - } - n.Content = a - } - - w := NewEncoder() - if err := w.WriteNode(n); err != nil { - return nil, err - } - - return w.GetData(), nil -} - -func marshalMessageArray(messages []interface{}) ([]Node, error) { - ret := make([]Node, len(messages)) - - for i, m := range messages { - if wmi, ok := m.(*pb.WebMessageInfo); ok { - b, err := marshalWebMessageInfo(wmi) - if err != nil { - return nil, nil - } - ret[i] = Node{"message", nil, b} - } else { - ret[i], ok = m.(Node) - if !ok { - return nil, fmt.Errorf("invalid Node") - } - } - } - - return ret, nil -} - -func marshalWebMessageInfo(p *pb.WebMessageInfo) ([]byte, error) { - b, err := proto.Marshal(p) - if err != nil { - return nil, err - } - return b, nil -} - -func Unmarshal(data []byte) (*Node, error) { - r := NewDecoder(data) - n, err := r.ReadNode() - if err != nil { - return nil, err - } - - if n != nil && n.Attributes != nil && n.Content != nil { - n.Content, err = unmarshalMessageArray(n.Content.([]Node)) - if err != nil { - return nil, err - } - } - - return n, nil -} - -func unmarshalMessageArray(messages []Node) ([]interface{}, error) { - ret := make([]interface{}, len(messages)) - - for i, msg := range messages { - if msg.Description == "message" { - info, err := unmarshalWebMessageInfo(msg.Content.([]byte)) - if err != nil { - return nil, err - } - ret[i] = info - } else { - ret[i] = msg - } - } - - return ret, nil -} - -func unmarshalWebMessageInfo(msg []byte) (*pb.WebMessageInfo, error) { - message := &pb.WebMessageInfo{} - err := proto.Unmarshal(msg, message) - if err != nil { - return nil, err - } - return message, nil -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/binary/proto/def.pb.go b/vendor/github.com/matterbridge/go-whatsapp/binary/proto/def.pb.go deleted file mode 100644 index 71d9923f..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/binary/proto/def.pb.go +++ /dev/null @@ -1,3800 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: def.proto - -package proto - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type ExtendedTextMessage_FONTTYPE int32 - -const ( - ExtendedTextMessage_SANS_SERIF ExtendedTextMessage_FONTTYPE = 0 - ExtendedTextMessage_SERIF ExtendedTextMessage_FONTTYPE = 1 - ExtendedTextMessage_NORICAN_REGULAR ExtendedTextMessage_FONTTYPE = 2 - ExtendedTextMessage_BRYNDAN_WRITE ExtendedTextMessage_FONTTYPE = 3 - ExtendedTextMessage_BEBASNEUE_REGULAR ExtendedTextMessage_FONTTYPE = 4 - ExtendedTextMessage_OSWALD_HEAVY ExtendedTextMessage_FONTTYPE = 5 -) - -var ExtendedTextMessage_FONTTYPE_name = map[int32]string{ - 0: "SANS_SERIF", - 1: "SERIF", - 2: "NORICAN_REGULAR", - 3: "BRYNDAN_WRITE", - 4: "BEBASNEUE_REGULAR", - 5: "OSWALD_HEAVY", -} -var ExtendedTextMessage_FONTTYPE_value = map[string]int32{ - "SANS_SERIF": 0, - "SERIF": 1, - "NORICAN_REGULAR": 2, - "BRYNDAN_WRITE": 3, - "BEBASNEUE_REGULAR": 4, - "OSWALD_HEAVY": 5, -} - -func (x ExtendedTextMessage_FONTTYPE) Enum() *ExtendedTextMessage_FONTTYPE { - p := new(ExtendedTextMessage_FONTTYPE) - *p = x - return p -} -func (x ExtendedTextMessage_FONTTYPE) String() string { - return proto.EnumName(ExtendedTextMessage_FONTTYPE_name, int32(x)) -} -func (x *ExtendedTextMessage_FONTTYPE) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ExtendedTextMessage_FONTTYPE_value, data, "ExtendedTextMessage_FONTTYPE") - if err != nil { - return err - } - *x = ExtendedTextMessage_FONTTYPE(value) - return nil -} -func (ExtendedTextMessage_FONTTYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{7, 0} -} - -type VideoMessage_ATTRIBUTION int32 - -const ( - VideoMessage_NONE VideoMessage_ATTRIBUTION = 0 - VideoMessage_GIPHY VideoMessage_ATTRIBUTION = 1 - VideoMessage_TENOR VideoMessage_ATTRIBUTION = 2 -) - -var VideoMessage_ATTRIBUTION_name = map[int32]string{ - 0: "NONE", - 1: "GIPHY", - 2: "TENOR", -} -var VideoMessage_ATTRIBUTION_value = map[string]int32{ - "NONE": 0, - "GIPHY": 1, - "TENOR": 2, -} - -func (x VideoMessage_ATTRIBUTION) Enum() *VideoMessage_ATTRIBUTION { - p := new(VideoMessage_ATTRIBUTION) - *p = x - return p -} -func (x VideoMessage_ATTRIBUTION) String() string { - return proto.EnumName(VideoMessage_ATTRIBUTION_name, int32(x)) -} -func (x *VideoMessage_ATTRIBUTION) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(VideoMessage_ATTRIBUTION_value, data, "VideoMessage_ATTRIBUTION") - if err != nil { - return err - } - *x = VideoMessage_ATTRIBUTION(value) - return nil -} -func (VideoMessage_ATTRIBUTION) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{10, 0} -} - -type ProtocolMessage_TYPE int32 - -const ( - ProtocolMessage_REVOKE ProtocolMessage_TYPE = 0 -) - -var ProtocolMessage_TYPE_name = map[int32]string{ - 0: "REVOKE", -} -var ProtocolMessage_TYPE_value = map[string]int32{ - "REVOKE": 0, -} - -func (x ProtocolMessage_TYPE) Enum() *ProtocolMessage_TYPE { - p := new(ProtocolMessage_TYPE) - *p = x - return p -} -func (x ProtocolMessage_TYPE) String() string { - return proto.EnumName(ProtocolMessage_TYPE_name, int32(x)) -} -func (x *ProtocolMessage_TYPE) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ProtocolMessage_TYPE_value, data, "ProtocolMessage_TYPE") - if err != nil { - return err - } - *x = ProtocolMessage_TYPE(value) - return nil -} -func (ProtocolMessage_TYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{13, 0} -} - -type HSMDateTimeComponent_DAYOFWEEKTYPE int32 - -const ( - HSMDateTimeComponent_MONDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 1 - HSMDateTimeComponent_TUESDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 2 - HSMDateTimeComponent_WEDNESDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 3 - HSMDateTimeComponent_THURSDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 4 - HSMDateTimeComponent_FRIDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 5 - HSMDateTimeComponent_SATURDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 6 - HSMDateTimeComponent_SUNDAY HSMDateTimeComponent_DAYOFWEEKTYPE = 7 -) - -var HSMDateTimeComponent_DAYOFWEEKTYPE_name = map[int32]string{ - 1: "MONDAY", - 2: "TUESDAY", - 3: "WEDNESDAY", - 4: "THURSDAY", - 5: "FRIDAY", - 6: "SATURDAY", - 7: "SUNDAY", -} -var HSMDateTimeComponent_DAYOFWEEKTYPE_value = map[string]int32{ - "MONDAY": 1, - "TUESDAY": 2, - "WEDNESDAY": 3, - "THURSDAY": 4, - "FRIDAY": 5, - "SATURDAY": 6, - "SUNDAY": 7, -} - -func (x HSMDateTimeComponent_DAYOFWEEKTYPE) Enum() *HSMDateTimeComponent_DAYOFWEEKTYPE { - p := new(HSMDateTimeComponent_DAYOFWEEKTYPE) - *p = x - return p -} -func (x HSMDateTimeComponent_DAYOFWEEKTYPE) String() string { - return proto.EnumName(HSMDateTimeComponent_DAYOFWEEKTYPE_name, int32(x)) -} -func (x *HSMDateTimeComponent_DAYOFWEEKTYPE) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(HSMDateTimeComponent_DAYOFWEEKTYPE_value, data, "HSMDateTimeComponent_DAYOFWEEKTYPE") - if err != nil { - return err - } - *x = HSMDateTimeComponent_DAYOFWEEKTYPE(value) - return nil -} -func (HSMDateTimeComponent_DAYOFWEEKTYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{16, 0} -} - -type HSMDateTimeComponent_CALENDARTYPE int32 - -const ( - HSMDateTimeComponent_GREGORIAN HSMDateTimeComponent_CALENDARTYPE = 1 - HSMDateTimeComponent_SOLAR_HIJRI HSMDateTimeComponent_CALENDARTYPE = 2 -) - -var HSMDateTimeComponent_CALENDARTYPE_name = map[int32]string{ - 1: "GREGORIAN", - 2: "SOLAR_HIJRI", -} -var HSMDateTimeComponent_CALENDARTYPE_value = map[string]int32{ - "GREGORIAN": 1, - "SOLAR_HIJRI": 2, -} - -func (x HSMDateTimeComponent_CALENDARTYPE) Enum() *HSMDateTimeComponent_CALENDARTYPE { - p := new(HSMDateTimeComponent_CALENDARTYPE) - *p = x - return p -} -func (x HSMDateTimeComponent_CALENDARTYPE) String() string { - return proto.EnumName(HSMDateTimeComponent_CALENDARTYPE_name, int32(x)) -} -func (x *HSMDateTimeComponent_CALENDARTYPE) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(HSMDateTimeComponent_CALENDARTYPE_value, data, "HSMDateTimeComponent_CALENDARTYPE") - if err != nil { - return err - } - *x = HSMDateTimeComponent_CALENDARTYPE(value) - return nil -} -func (HSMDateTimeComponent_CALENDARTYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{16, 1} -} - -type WebMessageInfo_STATUS int32 - -const ( - WebMessageInfo_ERROR WebMessageInfo_STATUS = 0 - WebMessageInfo_PENDING WebMessageInfo_STATUS = 1 - WebMessageInfo_SERVER_ACK WebMessageInfo_STATUS = 2 - WebMessageInfo_DELIVERY_ACK WebMessageInfo_STATUS = 3 - WebMessageInfo_READ WebMessageInfo_STATUS = 4 - WebMessageInfo_PLAYED WebMessageInfo_STATUS = 5 -) - -var WebMessageInfo_STATUS_name = map[int32]string{ - 0: "ERROR", - 1: "PENDING", - 2: "SERVER_ACK", - 3: "DELIVERY_ACK", - 4: "READ", - 5: "PLAYED", -} -var WebMessageInfo_STATUS_value = map[string]int32{ - "ERROR": 0, - "PENDING": 1, - "SERVER_ACK": 2, - "DELIVERY_ACK": 3, - "READ": 4, - "PLAYED": 5, -} - -func (x WebMessageInfo_STATUS) Enum() *WebMessageInfo_STATUS { - p := new(WebMessageInfo_STATUS) - *p = x - return p -} -func (x WebMessageInfo_STATUS) String() string { - return proto.EnumName(WebMessageInfo_STATUS_name, int32(x)) -} -func (x *WebMessageInfo_STATUS) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(WebMessageInfo_STATUS_value, data, "WebMessageInfo_STATUS") - if err != nil { - return err - } - *x = WebMessageInfo_STATUS(value) - return nil -} -func (WebMessageInfo_STATUS) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{30, 0} -} - -type WebMessageInfo_STUBTYPE int32 - -const ( - WebMessageInfo_UNKNOWN WebMessageInfo_STUBTYPE = 0 - WebMessageInfo_REVOKE WebMessageInfo_STUBTYPE = 1 - WebMessageInfo_CIPHERTEXT WebMessageInfo_STUBTYPE = 2 - WebMessageInfo_FUTUREPROOF WebMessageInfo_STUBTYPE = 3 - WebMessageInfo_NON_VERIFIED_TRANSITION WebMessageInfo_STUBTYPE = 4 - WebMessageInfo_UNVERIFIED_TRANSITION WebMessageInfo_STUBTYPE = 5 - WebMessageInfo_VERIFIED_TRANSITION WebMessageInfo_STUBTYPE = 6 - WebMessageInfo_VERIFIED_LOW_UNKNOWN WebMessageInfo_STUBTYPE = 7 - WebMessageInfo_VERIFIED_HIGH WebMessageInfo_STUBTYPE = 8 - WebMessageInfo_VERIFIED_INITIAL_UNKNOWN WebMessageInfo_STUBTYPE = 9 - WebMessageInfo_VERIFIED_INITIAL_LOW WebMessageInfo_STUBTYPE = 10 - WebMessageInfo_VERIFIED_INITIAL_HIGH WebMessageInfo_STUBTYPE = 11 - WebMessageInfo_VERIFIED_TRANSITION_ANY_TO_NONE WebMessageInfo_STUBTYPE = 12 - WebMessageInfo_VERIFIED_TRANSITION_ANY_TO_HIGH WebMessageInfo_STUBTYPE = 13 - WebMessageInfo_VERIFIED_TRANSITION_HIGH_TO_LOW WebMessageInfo_STUBTYPE = 14 - WebMessageInfo_VERIFIED_TRANSITION_HIGH_TO_UNKNOWN WebMessageInfo_STUBTYPE = 15 - WebMessageInfo_VERIFIED_TRANSITION_UNKNOWN_TO_LOW WebMessageInfo_STUBTYPE = 16 - WebMessageInfo_VERIFIED_TRANSITION_LOW_TO_UNKNOWN WebMessageInfo_STUBTYPE = 17 - WebMessageInfo_VERIFIED_TRANSITION_NONE_TO_LOW WebMessageInfo_STUBTYPE = 18 - WebMessageInfo_VERIFIED_TRANSITION_NONE_TO_UNKNOWN WebMessageInfo_STUBTYPE = 19 - WebMessageInfo_GROUP_CREATE WebMessageInfo_STUBTYPE = 20 - WebMessageInfo_GROUP_CHANGE_SUBJECT WebMessageInfo_STUBTYPE = 21 - WebMessageInfo_GROUP_CHANGE_ICON WebMessageInfo_STUBTYPE = 22 - WebMessageInfo_GROUP_CHANGE_INVITE_LINK WebMessageInfo_STUBTYPE = 23 - WebMessageInfo_GROUP_CHANGE_DESCRIPTION WebMessageInfo_STUBTYPE = 24 - WebMessageInfo_GROUP_CHANGE_RESTRICT WebMessageInfo_STUBTYPE = 25 - WebMessageInfo_GROUP_CHANGE_ANNOUNCE WebMessageInfo_STUBTYPE = 26 - WebMessageInfo_GROUP_PARTICIPANT_ADD WebMessageInfo_STUBTYPE = 27 - WebMessageInfo_GROUP_PARTICIPANT_REMOVE WebMessageInfo_STUBTYPE = 28 - WebMessageInfo_GROUP_PARTICIPANT_PROMOTE WebMessageInfo_STUBTYPE = 29 - WebMessageInfo_GROUP_PARTICIPANT_DEMOTE WebMessageInfo_STUBTYPE = 30 - WebMessageInfo_GROUP_PARTICIPANT_INVITE WebMessageInfo_STUBTYPE = 31 - WebMessageInfo_GROUP_PARTICIPANT_LEAVE WebMessageInfo_STUBTYPE = 32 - WebMessageInfo_GROUP_PARTICIPANT_CHANGE_NUMBER WebMessageInfo_STUBTYPE = 33 - WebMessageInfo_BROADCAST_CREATE WebMessageInfo_STUBTYPE = 34 - WebMessageInfo_BROADCAST_ADD WebMessageInfo_STUBTYPE = 35 - WebMessageInfo_BROADCAST_REMOVE WebMessageInfo_STUBTYPE = 36 - WebMessageInfo_GENERIC_NOTIFICATION WebMessageInfo_STUBTYPE = 37 - WebMessageInfo_E2E_IDENTITY_CHANGED WebMessageInfo_STUBTYPE = 38 - WebMessageInfo_E2E_ENCRYPTED WebMessageInfo_STUBTYPE = 39 - WebMessageInfo_CALL_MISSED_VOICE WebMessageInfo_STUBTYPE = 40 - WebMessageInfo_CALL_MISSED_VIDEO WebMessageInfo_STUBTYPE = 41 - WebMessageInfo_INDIVIDUAL_CHANGE_NUMBER WebMessageInfo_STUBTYPE = 42 - WebMessageInfo_GROUP_DELETE WebMessageInfo_STUBTYPE = 43 -) - -var WebMessageInfo_STUBTYPE_name = map[int32]string{ - 0: "UNKNOWN", - 1: "REVOKE", - 2: "CIPHERTEXT", - 3: "FUTUREPROOF", - 4: "NON_VERIFIED_TRANSITION", - 5: "UNVERIFIED_TRANSITION", - 6: "VERIFIED_TRANSITION", - 7: "VERIFIED_LOW_UNKNOWN", - 8: "VERIFIED_HIGH", - 9: "VERIFIED_INITIAL_UNKNOWN", - 10: "VERIFIED_INITIAL_LOW", - 11: "VERIFIED_INITIAL_HIGH", - 12: "VERIFIED_TRANSITION_ANY_TO_NONE", - 13: "VERIFIED_TRANSITION_ANY_TO_HIGH", - 14: "VERIFIED_TRANSITION_HIGH_TO_LOW", - 15: "VERIFIED_TRANSITION_HIGH_TO_UNKNOWN", - 16: "VERIFIED_TRANSITION_UNKNOWN_TO_LOW", - 17: "VERIFIED_TRANSITION_LOW_TO_UNKNOWN", - 18: "VERIFIED_TRANSITION_NONE_TO_LOW", - 19: "VERIFIED_TRANSITION_NONE_TO_UNKNOWN", - 20: "GROUP_CREATE", - 21: "GROUP_CHANGE_SUBJECT", - 22: "GROUP_CHANGE_ICON", - 23: "GROUP_CHANGE_INVITE_LINK", - 24: "GROUP_CHANGE_DESCRIPTION", - 25: "GROUP_CHANGE_RESTRICT", - 26: "GROUP_CHANGE_ANNOUNCE", - 27: "GROUP_PARTICIPANT_ADD", - 28: "GROUP_PARTICIPANT_REMOVE", - 29: "GROUP_PARTICIPANT_PROMOTE", - 30: "GROUP_PARTICIPANT_DEMOTE", - 31: "GROUP_PARTICIPANT_INVITE", - 32: "GROUP_PARTICIPANT_LEAVE", - 33: "GROUP_PARTICIPANT_CHANGE_NUMBER", - 34: "BROADCAST_CREATE", - 35: "BROADCAST_ADD", - 36: "BROADCAST_REMOVE", - 37: "GENERIC_NOTIFICATION", - 38: "E2E_IDENTITY_CHANGED", - 39: "E2E_ENCRYPTED", - 40: "CALL_MISSED_VOICE", - 41: "CALL_MISSED_VIDEO", - 42: "INDIVIDUAL_CHANGE_NUMBER", - 43: "GROUP_DELETE", -} -var WebMessageInfo_STUBTYPE_value = map[string]int32{ - "UNKNOWN": 0, - "REVOKE": 1, - "CIPHERTEXT": 2, - "FUTUREPROOF": 3, - "NON_VERIFIED_TRANSITION": 4, - "UNVERIFIED_TRANSITION": 5, - "VERIFIED_TRANSITION": 6, - "VERIFIED_LOW_UNKNOWN": 7, - "VERIFIED_HIGH": 8, - "VERIFIED_INITIAL_UNKNOWN": 9, - "VERIFIED_INITIAL_LOW": 10, - "VERIFIED_INITIAL_HIGH": 11, - "VERIFIED_TRANSITION_ANY_TO_NONE": 12, - "VERIFIED_TRANSITION_ANY_TO_HIGH": 13, - "VERIFIED_TRANSITION_HIGH_TO_LOW": 14, - "VERIFIED_TRANSITION_HIGH_TO_UNKNOWN": 15, - "VERIFIED_TRANSITION_UNKNOWN_TO_LOW": 16, - "VERIFIED_TRANSITION_LOW_TO_UNKNOWN": 17, - "VERIFIED_TRANSITION_NONE_TO_LOW": 18, - "VERIFIED_TRANSITION_NONE_TO_UNKNOWN": 19, - "GROUP_CREATE": 20, - "GROUP_CHANGE_SUBJECT": 21, - "GROUP_CHANGE_ICON": 22, - "GROUP_CHANGE_INVITE_LINK": 23, - "GROUP_CHANGE_DESCRIPTION": 24, - "GROUP_CHANGE_RESTRICT": 25, - "GROUP_CHANGE_ANNOUNCE": 26, - "GROUP_PARTICIPANT_ADD": 27, - "GROUP_PARTICIPANT_REMOVE": 28, - "GROUP_PARTICIPANT_PROMOTE": 29, - "GROUP_PARTICIPANT_DEMOTE": 30, - "GROUP_PARTICIPANT_INVITE": 31, - "GROUP_PARTICIPANT_LEAVE": 32, - "GROUP_PARTICIPANT_CHANGE_NUMBER": 33, - "BROADCAST_CREATE": 34, - "BROADCAST_ADD": 35, - "BROADCAST_REMOVE": 36, - "GENERIC_NOTIFICATION": 37, - "E2E_IDENTITY_CHANGED": 38, - "E2E_ENCRYPTED": 39, - "CALL_MISSED_VOICE": 40, - "CALL_MISSED_VIDEO": 41, - "INDIVIDUAL_CHANGE_NUMBER": 42, - "GROUP_DELETE": 43, -} - -func (x WebMessageInfo_STUBTYPE) Enum() *WebMessageInfo_STUBTYPE { - p := new(WebMessageInfo_STUBTYPE) - *p = x - return p -} -func (x WebMessageInfo_STUBTYPE) String() string { - return proto.EnumName(WebMessageInfo_STUBTYPE_name, int32(x)) -} -func (x *WebMessageInfo_STUBTYPE) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(WebMessageInfo_STUBTYPE_value, data, "WebMessageInfo_STUBTYPE") - if err != nil { - return err - } - *x = WebMessageInfo_STUBTYPE(value) - return nil -} -func (WebMessageInfo_STUBTYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{30, 1} -} - -type WebFeatures_FLAG int32 - -const ( - WebFeatures_NOT_IMPLEMENTED WebFeatures_FLAG = 0 - WebFeatures_IMPLEMENTED WebFeatures_FLAG = 1 - WebFeatures_OPTIONAL WebFeatures_FLAG = 2 -) - -var WebFeatures_FLAG_name = map[int32]string{ - 0: "NOT_IMPLEMENTED", - 1: "IMPLEMENTED", - 2: "OPTIONAL", -} -var WebFeatures_FLAG_value = map[string]int32{ - "NOT_IMPLEMENTED": 0, - "IMPLEMENTED": 1, - "OPTIONAL": 2, -} - -func (x WebFeatures_FLAG) Enum() *WebFeatures_FLAG { - p := new(WebFeatures_FLAG) - *p = x - return p -} -func (x WebFeatures_FLAG) String() string { - return proto.EnumName(WebFeatures_FLAG_name, int32(x)) -} -func (x *WebFeatures_FLAG) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(WebFeatures_FLAG_value, data, "WebFeatures_FLAG") - if err != nil { - return err - } - *x = WebFeatures_FLAG(value) - return nil -} -func (WebFeatures_FLAG) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{34, 0} -} - -type FingerprintData struct { - PublicKey *string `protobuf:"bytes,1,opt,name=publicKey" json:"publicKey,omitempty"` - Identifier *string `protobuf:"bytes,2,opt,name=identifier" json:"identifier,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FingerprintData) Reset() { *m = FingerprintData{} } -func (m *FingerprintData) String() string { return proto.CompactTextString(m) } -func (*FingerprintData) ProtoMessage() {} -func (*FingerprintData) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{0} -} -func (m *FingerprintData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FingerprintData.Unmarshal(m, b) -} -func (m *FingerprintData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FingerprintData.Marshal(b, m, deterministic) -} -func (dst *FingerprintData) XXX_Merge(src proto.Message) { - xxx_messageInfo_FingerprintData.Merge(dst, src) -} -func (m *FingerprintData) XXX_Size() int { - return xxx_messageInfo_FingerprintData.Size(m) -} -func (m *FingerprintData) XXX_DiscardUnknown() { - xxx_messageInfo_FingerprintData.DiscardUnknown(m) -} - -var xxx_messageInfo_FingerprintData proto.InternalMessageInfo - -func (m *FingerprintData) GetPublicKey() string { - if m != nil && m.PublicKey != nil { - return *m.PublicKey - } - return "" -} - -func (m *FingerprintData) GetIdentifier() string { - if m != nil && m.Identifier != nil { - return *m.Identifier - } - return "" -} - -type CombinedFingerprint struct { - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` - LocalFingerprint *FingerprintData `protobuf:"bytes,2,opt,name=localFingerprint" json:"localFingerprint,omitempty"` - RemoteFingerprint *FingerprintData `protobuf:"bytes,3,opt,name=remoteFingerprint" json:"remoteFingerprint,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CombinedFingerprint) Reset() { *m = CombinedFingerprint{} } -func (m *CombinedFingerprint) String() string { return proto.CompactTextString(m) } -func (*CombinedFingerprint) ProtoMessage() {} -func (*CombinedFingerprint) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{1} -} -func (m *CombinedFingerprint) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CombinedFingerprint.Unmarshal(m, b) -} -func (m *CombinedFingerprint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CombinedFingerprint.Marshal(b, m, deterministic) -} -func (dst *CombinedFingerprint) XXX_Merge(src proto.Message) { - xxx_messageInfo_CombinedFingerprint.Merge(dst, src) -} -func (m *CombinedFingerprint) XXX_Size() int { - return xxx_messageInfo_CombinedFingerprint.Size(m) -} -func (m *CombinedFingerprint) XXX_DiscardUnknown() { - xxx_messageInfo_CombinedFingerprint.DiscardUnknown(m) -} - -var xxx_messageInfo_CombinedFingerprint proto.InternalMessageInfo - -func (m *CombinedFingerprint) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CombinedFingerprint) GetLocalFingerprint() *FingerprintData { - if m != nil { - return m.LocalFingerprint - } - return nil -} - -func (m *CombinedFingerprint) GetRemoteFingerprint() *FingerprintData { - if m != nil { - return m.RemoteFingerprint - } - return nil -} - -type MessageKey struct { - RemoteJid *string `protobuf:"bytes,1,opt,name=remoteJid" json:"remoteJid,omitempty"` - FromMe *bool `protobuf:"varint,2,opt,name=fromMe" json:"fromMe,omitempty"` - Id *string `protobuf:"bytes,3,opt,name=id" json:"id,omitempty"` - Participant *string `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageKey) Reset() { *m = MessageKey{} } -func (m *MessageKey) String() string { return proto.CompactTextString(m) } -func (*MessageKey) ProtoMessage() {} -func (*MessageKey) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{2} -} -func (m *MessageKey) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageKey.Unmarshal(m, b) -} -func (m *MessageKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageKey.Marshal(b, m, deterministic) -} -func (dst *MessageKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageKey.Merge(dst, src) -} -func (m *MessageKey) XXX_Size() int { - return xxx_messageInfo_MessageKey.Size(m) -} -func (m *MessageKey) XXX_DiscardUnknown() { - xxx_messageInfo_MessageKey.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageKey proto.InternalMessageInfo - -func (m *MessageKey) GetRemoteJid() string { - if m != nil && m.RemoteJid != nil { - return *m.RemoteJid - } - return "" -} - -func (m *MessageKey) GetFromMe() bool { - if m != nil && m.FromMe != nil { - return *m.FromMe - } - return false -} - -func (m *MessageKey) GetId() string { - if m != nil && m.Id != nil { - return *m.Id - } - return "" -} - -func (m *MessageKey) GetParticipant() string { - if m != nil && m.Participant != nil { - return *m.Participant - } - return "" -} - -type SenderKeyDistributionMessage struct { - GroupId *string `protobuf:"bytes,1,opt,name=groupId" json:"groupId,omitempty"` - AxolotlSenderKeyDistributionMessage []byte `protobuf:"bytes,2,opt,name=axolotlSenderKeyDistributionMessage" json:"axolotlSenderKeyDistributionMessage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SenderKeyDistributionMessage) Reset() { *m = SenderKeyDistributionMessage{} } -func (m *SenderKeyDistributionMessage) String() string { return proto.CompactTextString(m) } -func (*SenderKeyDistributionMessage) ProtoMessage() {} -func (*SenderKeyDistributionMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{3} -} -func (m *SenderKeyDistributionMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SenderKeyDistributionMessage.Unmarshal(m, b) -} -func (m *SenderKeyDistributionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SenderKeyDistributionMessage.Marshal(b, m, deterministic) -} -func (dst *SenderKeyDistributionMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_SenderKeyDistributionMessage.Merge(dst, src) -} -func (m *SenderKeyDistributionMessage) XXX_Size() int { - return xxx_messageInfo_SenderKeyDistributionMessage.Size(m) -} -func (m *SenderKeyDistributionMessage) XXX_DiscardUnknown() { - xxx_messageInfo_SenderKeyDistributionMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_SenderKeyDistributionMessage proto.InternalMessageInfo - -func (m *SenderKeyDistributionMessage) GetGroupId() string { - if m != nil && m.GroupId != nil { - return *m.GroupId - } - return "" -} - -func (m *SenderKeyDistributionMessage) GetAxolotlSenderKeyDistributionMessage() []byte { - if m != nil { - return m.AxolotlSenderKeyDistributionMessage - } - return nil -} - -type ImageMessage struct { - Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` - Mimetype *string `protobuf:"bytes,2,opt,name=mimetype" json:"mimetype,omitempty"` - Caption *string `protobuf:"bytes,3,opt,name=caption" json:"caption,omitempty"` - FileSha256 []byte `protobuf:"bytes,4,opt,name=fileSha256" json:"fileSha256,omitempty"` - FileLength *uint64 `protobuf:"varint,5,opt,name=fileLength" json:"fileLength,omitempty"` - Height *uint32 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` - Width *uint32 `protobuf:"varint,7,opt,name=width" json:"width,omitempty"` - MediaKey []byte `protobuf:"bytes,8,opt,name=mediaKey" json:"mediaKey,omitempty"` - FileEncSha256 []byte `protobuf:"bytes,9,opt,name=fileEncSha256" json:"fileEncSha256,omitempty"` - InteractiveAnnotations []*InteractiveAnnotation `protobuf:"bytes,10,rep,name=interactiveAnnotations" json:"interactiveAnnotations,omitempty"` - DirectPath *string `protobuf:"bytes,11,opt,name=directPath" json:"directPath,omitempty"` - JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` - ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` - FirstScanSidecar []byte `protobuf:"bytes,18,opt,name=firstScanSidecar" json:"firstScanSidecar,omitempty"` - FirstScanLength *uint32 `protobuf:"varint,19,opt,name=firstScanLength" json:"firstScanLength,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ImageMessage) Reset() { *m = ImageMessage{} } -func (m *ImageMessage) String() string { return proto.CompactTextString(m) } -func (*ImageMessage) ProtoMessage() {} -func (*ImageMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{4} -} -func (m *ImageMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ImageMessage.Unmarshal(m, b) -} -func (m *ImageMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ImageMessage.Marshal(b, m, deterministic) -} -func (dst *ImageMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_ImageMessage.Merge(dst, src) -} -func (m *ImageMessage) XXX_Size() int { - return xxx_messageInfo_ImageMessage.Size(m) -} -func (m *ImageMessage) XXX_DiscardUnknown() { - xxx_messageInfo_ImageMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_ImageMessage proto.InternalMessageInfo - -func (m *ImageMessage) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *ImageMessage) GetMimetype() string { - if m != nil && m.Mimetype != nil { - return *m.Mimetype - } - return "" -} - -func (m *ImageMessage) GetCaption() string { - if m != nil && m.Caption != nil { - return *m.Caption - } - return "" -} - -func (m *ImageMessage) GetFileSha256() []byte { - if m != nil { - return m.FileSha256 - } - return nil -} - -func (m *ImageMessage) GetFileLength() uint64 { - if m != nil && m.FileLength != nil { - return *m.FileLength - } - return 0 -} - -func (m *ImageMessage) GetHeight() uint32 { - if m != nil && m.Height != nil { - return *m.Height - } - return 0 -} - -func (m *ImageMessage) GetWidth() uint32 { - if m != nil && m.Width != nil { - return *m.Width - } - return 0 -} - -func (m *ImageMessage) GetMediaKey() []byte { - if m != nil { - return m.MediaKey - } - return nil -} - -func (m *ImageMessage) GetFileEncSha256() []byte { - if m != nil { - return m.FileEncSha256 - } - return nil -} - -func (m *ImageMessage) GetInteractiveAnnotations() []*InteractiveAnnotation { - if m != nil { - return m.InteractiveAnnotations - } - return nil -} - -func (m *ImageMessage) GetDirectPath() string { - if m != nil && m.DirectPath != nil { - return *m.DirectPath - } - return "" -} - -func (m *ImageMessage) GetJpegThumbnail() []byte { - if m != nil { - return m.JpegThumbnail - } - return nil -} - -func (m *ImageMessage) GetContextInfo() *ContextInfo { - if m != nil { - return m.ContextInfo - } - return nil -} - -func (m *ImageMessage) GetFirstScanSidecar() []byte { - if m != nil { - return m.FirstScanSidecar - } - return nil -} - -func (m *ImageMessage) GetFirstScanLength() uint32 { - if m != nil && m.FirstScanLength != nil { - return *m.FirstScanLength - } - return 0 -} - -type ContactMessage struct { - DisplayName *string `protobuf:"bytes,1,opt,name=displayName" json:"displayName,omitempty"` - Vcard *string `protobuf:"bytes,16,opt,name=vcard" json:"vcard,omitempty"` - ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ContactMessage) Reset() { *m = ContactMessage{} } -func (m *ContactMessage) String() string { return proto.CompactTextString(m) } -func (*ContactMessage) ProtoMessage() {} -func (*ContactMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{5} -} -func (m *ContactMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ContactMessage.Unmarshal(m, b) -} -func (m *ContactMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ContactMessage.Marshal(b, m, deterministic) -} -func (dst *ContactMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContactMessage.Merge(dst, src) -} -func (m *ContactMessage) XXX_Size() int { - return xxx_messageInfo_ContactMessage.Size(m) -} -func (m *ContactMessage) XXX_DiscardUnknown() { - xxx_messageInfo_ContactMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_ContactMessage proto.InternalMessageInfo - -func (m *ContactMessage) GetDisplayName() string { - if m != nil && m.DisplayName != nil { - return *m.DisplayName - } - return "" -} - -func (m *ContactMessage) GetVcard() string { - if m != nil && m.Vcard != nil { - return *m.Vcard - } - return "" -} - -func (m *ContactMessage) GetContextInfo() *ContextInfo { - if m != nil { - return m.ContextInfo - } - return nil -} - -type LocationMessage struct { - DegreesLatitude *float64 `protobuf:"fixed64,1,opt,name=degreesLatitude" json:"degreesLatitude,omitempty"` - DegreesLongitude *float64 `protobuf:"fixed64,2,opt,name=degreesLongitude" json:"degreesLongitude,omitempty"` - Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` - Address *string `protobuf:"bytes,4,opt,name=address" json:"address,omitempty"` - Url *string `protobuf:"bytes,5,opt,name=url" json:"url,omitempty"` - JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` - ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LocationMessage) Reset() { *m = LocationMessage{} } -func (m *LocationMessage) String() string { return proto.CompactTextString(m) } -func (*LocationMessage) ProtoMessage() {} -func (*LocationMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{6} -} -func (m *LocationMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LocationMessage.Unmarshal(m, b) -} -func (m *LocationMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LocationMessage.Marshal(b, m, deterministic) -} -func (dst *LocationMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocationMessage.Merge(dst, src) -} -func (m *LocationMessage) XXX_Size() int { - return xxx_messageInfo_LocationMessage.Size(m) -} -func (m *LocationMessage) XXX_DiscardUnknown() { - xxx_messageInfo_LocationMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_LocationMessage proto.InternalMessageInfo - -func (m *LocationMessage) GetDegreesLatitude() float64 { - if m != nil && m.DegreesLatitude != nil { - return *m.DegreesLatitude - } - return 0 -} - -func (m *LocationMessage) GetDegreesLongitude() float64 { - if m != nil && m.DegreesLongitude != nil { - return *m.DegreesLongitude - } - return 0 -} - -func (m *LocationMessage) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *LocationMessage) GetAddress() string { - if m != nil && m.Address != nil { - return *m.Address - } - return "" -} - -func (m *LocationMessage) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *LocationMessage) GetJpegThumbnail() []byte { - if m != nil { - return m.JpegThumbnail - } - return nil -} - -func (m *LocationMessage) GetContextInfo() *ContextInfo { - if m != nil { - return m.ContextInfo - } - return nil -} - -type ExtendedTextMessage struct { - Text *string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` - MatchedText *string `protobuf:"bytes,2,opt,name=matchedText" json:"matchedText,omitempty"` - CanonicalUrl *string `protobuf:"bytes,4,opt,name=canonicalUrl" json:"canonicalUrl,omitempty"` - Description *string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"` - Title *string `protobuf:"bytes,6,opt,name=title" json:"title,omitempty"` - TextArgb *uint32 `protobuf:"fixed32,7,opt,name=textArgb" json:"textArgb,omitempty"` - BackgroundArgb *uint32 `protobuf:"fixed32,8,opt,name=backgroundArgb" json:"backgroundArgb,omitempty"` - Font *ExtendedTextMessage_FONTTYPE `protobuf:"varint,9,opt,name=font,enum=proto.ExtendedTextMessage_FONTTYPE" json:"font,omitempty"` - JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` - ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExtendedTextMessage) Reset() { *m = ExtendedTextMessage{} } -func (m *ExtendedTextMessage) String() string { return proto.CompactTextString(m) } -func (*ExtendedTextMessage) ProtoMessage() {} -func (*ExtendedTextMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{7} -} -func (m *ExtendedTextMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtendedTextMessage.Unmarshal(m, b) -} -func (m *ExtendedTextMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtendedTextMessage.Marshal(b, m, deterministic) -} -func (dst *ExtendedTextMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtendedTextMessage.Merge(dst, src) -} -func (m *ExtendedTextMessage) XXX_Size() int { - return xxx_messageInfo_ExtendedTextMessage.Size(m) -} -func (m *ExtendedTextMessage) XXX_DiscardUnknown() { - xxx_messageInfo_ExtendedTextMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_ExtendedTextMessage proto.InternalMessageInfo - -func (m *ExtendedTextMessage) GetText() string { - if m != nil && m.Text != nil { - return *m.Text - } - return "" -} - -func (m *ExtendedTextMessage) GetMatchedText() string { - if m != nil && m.MatchedText != nil { - return *m.MatchedText - } - return "" -} - -func (m *ExtendedTextMessage) GetCanonicalUrl() string { - if m != nil && m.CanonicalUrl != nil { - return *m.CanonicalUrl - } - return "" -} - -func (m *ExtendedTextMessage) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -func (m *ExtendedTextMessage) GetTitle() string { - if m != nil && m.Title != nil { - return *m.Title - } - return "" -} - -func (m *ExtendedTextMessage) GetTextArgb() uint32 { - if m != nil && m.TextArgb != nil { - return *m.TextArgb - } - return 0 -} - -func (m *ExtendedTextMessage) GetBackgroundArgb() uint32 { - if m != nil && m.BackgroundArgb != nil { - return *m.BackgroundArgb - } - return 0 -} - -func (m *ExtendedTextMessage) GetFont() ExtendedTextMessage_FONTTYPE { - if m != nil && m.Font != nil { - return *m.Font - } - return ExtendedTextMessage_SANS_SERIF -} - -func (m *ExtendedTextMessage) GetJpegThumbnail() []byte { - if m != nil { - return m.JpegThumbnail - } - return nil -} - -func (m *ExtendedTextMessage) GetContextInfo() *ContextInfo { - if m != nil { - return m.ContextInfo - } - return nil -} - -type DocumentMessage struct { - Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` - Mimetype *string `protobuf:"bytes,2,opt,name=mimetype" json:"mimetype,omitempty"` - Title *string `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` - FileSha256 []byte `protobuf:"bytes,4,opt,name=fileSha256" json:"fileSha256,omitempty"` - FileLength *uint64 `protobuf:"varint,5,opt,name=fileLength" json:"fileLength,omitempty"` - PageCount *uint32 `protobuf:"varint,6,opt,name=pageCount" json:"pageCount,omitempty"` - MediaKey []byte `protobuf:"bytes,7,opt,name=mediaKey" json:"mediaKey,omitempty"` - FileName *string `protobuf:"bytes,8,opt,name=fileName" json:"fileName,omitempty"` - FileEncSha256 []byte `protobuf:"bytes,9,opt,name=fileEncSha256" json:"fileEncSha256,omitempty"` - DirectPath *string `protobuf:"bytes,10,opt,name=directPath" json:"directPath,omitempty"` - JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` - ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DocumentMessage) Reset() { *m = DocumentMessage{} } -func (m *DocumentMessage) String() string { return proto.CompactTextString(m) } -func (*DocumentMessage) ProtoMessage() {} -func (*DocumentMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{8} -} -func (m *DocumentMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DocumentMessage.Unmarshal(m, b) -} -func (m *DocumentMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DocumentMessage.Marshal(b, m, deterministic) -} -func (dst *DocumentMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_DocumentMessage.Merge(dst, src) -} -func (m *DocumentMessage) XXX_Size() int { - return xxx_messageInfo_DocumentMessage.Size(m) -} -func (m *DocumentMessage) XXX_DiscardUnknown() { - xxx_messageInfo_DocumentMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_DocumentMessage proto.InternalMessageInfo - -func (m *DocumentMessage) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *DocumentMessage) GetMimetype() string { - if m != nil && m.Mimetype != nil { - return *m.Mimetype - } - return "" -} - -func (m *DocumentMessage) GetTitle() string { - if m != nil && m.Title != nil { - return *m.Title - } - return "" -} - -func (m *DocumentMessage) GetFileSha256() []byte { - if m != nil { - return m.FileSha256 - } - return nil -} - -func (m *DocumentMessage) GetFileLength() uint64 { - if m != nil && m.FileLength != nil { - return *m.FileLength - } - return 0 -} - -func (m *DocumentMessage) GetPageCount() uint32 { - if m != nil && m.PageCount != nil { - return *m.PageCount - } - return 0 -} - -func (m *DocumentMessage) GetMediaKey() []byte { - if m != nil { - return m.MediaKey - } - return nil -} - -func (m *DocumentMessage) GetFileName() string { - if m != nil && m.FileName != nil { - return *m.FileName - } - return "" -} - -func (m *DocumentMessage) GetFileEncSha256() []byte { - if m != nil { - return m.FileEncSha256 - } - return nil -} - -func (m *DocumentMessage) GetDirectPath() string { - if m != nil && m.DirectPath != nil { - return *m.DirectPath - } - return "" -} - -func (m *DocumentMessage) GetJpegThumbnail() []byte { - if m != nil { - return m.JpegThumbnail - } - return nil -} - -func (m *DocumentMessage) GetContextInfo() *ContextInfo { - if m != nil { - return m.ContextInfo - } - return nil -} - -type AudioMessage struct { - Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` - Mimetype *string `protobuf:"bytes,2,opt,name=mimetype" json:"mimetype,omitempty"` - FileSha256 []byte `protobuf:"bytes,3,opt,name=fileSha256" json:"fileSha256,omitempty"` - FileLength *uint64 `protobuf:"varint,4,opt,name=fileLength" json:"fileLength,omitempty"` - Seconds *uint32 `protobuf:"varint,5,opt,name=seconds" json:"seconds,omitempty"` - Ptt *bool `protobuf:"varint,6,opt,name=ptt" json:"ptt,omitempty"` - MediaKey []byte `protobuf:"bytes,7,opt,name=mediaKey" json:"mediaKey,omitempty"` - FileEncSha256 []byte `protobuf:"bytes,8,opt,name=fileEncSha256" json:"fileEncSha256,omitempty"` - DirectPath *string `protobuf:"bytes,9,opt,name=directPath" json:"directPath,omitempty"` - ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` - StreamingSidecar []byte `protobuf:"bytes,18,opt,name=streamingSidecar" json:"streamingSidecar,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AudioMessage) Reset() { *m = AudioMessage{} } -func (m *AudioMessage) String() string { return proto.CompactTextString(m) } -func (*AudioMessage) ProtoMessage() {} -func (*AudioMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{9} -} -func (m *AudioMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AudioMessage.Unmarshal(m, b) -} -func (m *AudioMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AudioMessage.Marshal(b, m, deterministic) -} -func (dst *AudioMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_AudioMessage.Merge(dst, src) -} -func (m *AudioMessage) XXX_Size() int { - return xxx_messageInfo_AudioMessage.Size(m) -} -func (m *AudioMessage) XXX_DiscardUnknown() { - xxx_messageInfo_AudioMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_AudioMessage proto.InternalMessageInfo - -func (m *AudioMessage) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *AudioMessage) GetMimetype() string { - if m != nil && m.Mimetype != nil { - return *m.Mimetype - } - return "" -} - -func (m *AudioMessage) GetFileSha256() []byte { - if m != nil { - return m.FileSha256 - } - return nil -} - -func (m *AudioMessage) GetFileLength() uint64 { - if m != nil && m.FileLength != nil { - return *m.FileLength - } - return 0 -} - -func (m *AudioMessage) GetSeconds() uint32 { - if m != nil && m.Seconds != nil { - return *m.Seconds - } - return 0 -} - -func (m *AudioMessage) GetPtt() bool { - if m != nil && m.Ptt != nil { - return *m.Ptt - } - return false -} - -func (m *AudioMessage) GetMediaKey() []byte { - if m != nil { - return m.MediaKey - } - return nil -} - -func (m *AudioMessage) GetFileEncSha256() []byte { - if m != nil { - return m.FileEncSha256 - } - return nil -} - -func (m *AudioMessage) GetDirectPath() string { - if m != nil && m.DirectPath != nil { - return *m.DirectPath - } - return "" -} - -func (m *AudioMessage) GetContextInfo() *ContextInfo { - if m != nil { - return m.ContextInfo - } - return nil -} - -func (m *AudioMessage) GetStreamingSidecar() []byte { - if m != nil { - return m.StreamingSidecar - } - return nil -} - -type VideoMessage struct { - Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` - Mimetype *string `protobuf:"bytes,2,opt,name=mimetype" json:"mimetype,omitempty"` - FileSha256 []byte `protobuf:"bytes,3,opt,name=fileSha256" json:"fileSha256,omitempty"` - FileLength *uint64 `protobuf:"varint,4,opt,name=fileLength" json:"fileLength,omitempty"` - Seconds *uint32 `protobuf:"varint,5,opt,name=seconds" json:"seconds,omitempty"` - MediaKey []byte `protobuf:"bytes,6,opt,name=mediaKey" json:"mediaKey,omitempty"` - Caption *string `protobuf:"bytes,7,opt,name=caption" json:"caption,omitempty"` - GifPlayback *bool `protobuf:"varint,8,opt,name=gifPlayback" json:"gifPlayback,omitempty"` - Height *uint32 `protobuf:"varint,9,opt,name=height" json:"height,omitempty"` - Width *uint32 `protobuf:"varint,10,opt,name=width" json:"width,omitempty"` - FileEncSha256 []byte `protobuf:"bytes,11,opt,name=fileEncSha256" json:"fileEncSha256,omitempty"` - InteractiveAnnotations []*InteractiveAnnotation `protobuf:"bytes,12,rep,name=interactiveAnnotations" json:"interactiveAnnotations,omitempty"` - DirectPath *string `protobuf:"bytes,13,opt,name=directPath" json:"directPath,omitempty"` - JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` - ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` - StreamingSidecar []byte `protobuf:"bytes,18,opt,name=streamingSidecar" json:"streamingSidecar,omitempty"` - GifAttribution *VideoMessage_ATTRIBUTION `protobuf:"varint,19,opt,name=gifAttribution,enum=proto.VideoMessage_ATTRIBUTION" json:"gifAttribution,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VideoMessage) Reset() { *m = VideoMessage{} } -func (m *VideoMessage) String() string { return proto.CompactTextString(m) } -func (*VideoMessage) ProtoMessage() {} -func (*VideoMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{10} -} -func (m *VideoMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VideoMessage.Unmarshal(m, b) -} -func (m *VideoMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VideoMessage.Marshal(b, m, deterministic) -} -func (dst *VideoMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_VideoMessage.Merge(dst, src) -} -func (m *VideoMessage) XXX_Size() int { - return xxx_messageInfo_VideoMessage.Size(m) -} -func (m *VideoMessage) XXX_DiscardUnknown() { - xxx_messageInfo_VideoMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_VideoMessage proto.InternalMessageInfo - -func (m *VideoMessage) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *VideoMessage) GetMimetype() string { - if m != nil && m.Mimetype != nil { - return *m.Mimetype - } - return "" -} - -func (m *VideoMessage) GetFileSha256() []byte { - if m != nil { - return m.FileSha256 - } - return nil -} - -func (m *VideoMessage) GetFileLength() uint64 { - if m != nil && m.FileLength != nil { - return *m.FileLength - } - return 0 -} - -func (m *VideoMessage) GetSeconds() uint32 { - if m != nil && m.Seconds != nil { - return *m.Seconds - } - return 0 -} - -func (m *VideoMessage) GetMediaKey() []byte { - if m != nil { - return m.MediaKey - } - return nil -} - -func (m *VideoMessage) GetCaption() string { - if m != nil && m.Caption != nil { - return *m.Caption - } - return "" -} - -func (m *VideoMessage) GetGifPlayback() bool { - if m != nil && m.GifPlayback != nil { - return *m.GifPlayback - } - return false -} - -func (m *VideoMessage) GetHeight() uint32 { - if m != nil && m.Height != nil { - return *m.Height - } - return 0 -} - -func (m *VideoMessage) GetWidth() uint32 { - if m != nil && m.Width != nil { - return *m.Width - } - return 0 -} - -func (m *VideoMessage) GetFileEncSha256() []byte { - if m != nil { - return m.FileEncSha256 - } - return nil -} - -func (m *VideoMessage) GetInteractiveAnnotations() []*InteractiveAnnotation { - if m != nil { - return m.InteractiveAnnotations - } - return nil -} - -func (m *VideoMessage) GetDirectPath() string { - if m != nil && m.DirectPath != nil { - return *m.DirectPath - } - return "" -} - -func (m *VideoMessage) GetJpegThumbnail() []byte { - if m != nil { - return m.JpegThumbnail - } - return nil -} - -func (m *VideoMessage) GetContextInfo() *ContextInfo { - if m != nil { - return m.ContextInfo - } - return nil -} - -func (m *VideoMessage) GetStreamingSidecar() []byte { - if m != nil { - return m.StreamingSidecar - } - return nil -} - -func (m *VideoMessage) GetGifAttribution() VideoMessage_ATTRIBUTION { - if m != nil && m.GifAttribution != nil { - return *m.GifAttribution - } - return VideoMessage_NONE -} - -type Call struct { - CallKey []byte `protobuf:"bytes,1,opt,name=callKey" json:"callKey,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Call) Reset() { *m = Call{} } -func (m *Call) String() string { return proto.CompactTextString(m) } -func (*Call) ProtoMessage() {} -func (*Call) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{11} -} -func (m *Call) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Call.Unmarshal(m, b) -} -func (m *Call) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Call.Marshal(b, m, deterministic) -} -func (dst *Call) XXX_Merge(src proto.Message) { - xxx_messageInfo_Call.Merge(dst, src) -} -func (m *Call) XXX_Size() int { - return xxx_messageInfo_Call.Size(m) -} -func (m *Call) XXX_DiscardUnknown() { - xxx_messageInfo_Call.DiscardUnknown(m) -} - -var xxx_messageInfo_Call proto.InternalMessageInfo - -func (m *Call) GetCallKey() []byte { - if m != nil { - return m.CallKey - } - return nil -} - -type Chat struct { - DisplayName *string `protobuf:"bytes,1,opt,name=displayName" json:"displayName,omitempty"` - Id *string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Chat) Reset() { *m = Chat{} } -func (m *Chat) String() string { return proto.CompactTextString(m) } -func (*Chat) ProtoMessage() {} -func (*Chat) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{12} -} -func (m *Chat) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Chat.Unmarshal(m, b) -} -func (m *Chat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Chat.Marshal(b, m, deterministic) -} -func (dst *Chat) XXX_Merge(src proto.Message) { - xxx_messageInfo_Chat.Merge(dst, src) -} -func (m *Chat) XXX_Size() int { - return xxx_messageInfo_Chat.Size(m) -} -func (m *Chat) XXX_DiscardUnknown() { - xxx_messageInfo_Chat.DiscardUnknown(m) -} - -var xxx_messageInfo_Chat proto.InternalMessageInfo - -func (m *Chat) GetDisplayName() string { - if m != nil && m.DisplayName != nil { - return *m.DisplayName - } - return "" -} - -func (m *Chat) GetId() string { - if m != nil && m.Id != nil { - return *m.Id - } - return "" -} - -type ProtocolMessage struct { - Key *MessageKey `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - Type *ProtocolMessage_TYPE `protobuf:"varint,2,opt,name=type,enum=proto.ProtocolMessage_TYPE" json:"type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ProtocolMessage) Reset() { *m = ProtocolMessage{} } -func (m *ProtocolMessage) String() string { return proto.CompactTextString(m) } -func (*ProtocolMessage) ProtoMessage() {} -func (*ProtocolMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{13} -} -func (m *ProtocolMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ProtocolMessage.Unmarshal(m, b) -} -func (m *ProtocolMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ProtocolMessage.Marshal(b, m, deterministic) -} -func (dst *ProtocolMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProtocolMessage.Merge(dst, src) -} -func (m *ProtocolMessage) XXX_Size() int { - return xxx_messageInfo_ProtocolMessage.Size(m) -} -func (m *ProtocolMessage) XXX_DiscardUnknown() { - xxx_messageInfo_ProtocolMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_ProtocolMessage proto.InternalMessageInfo - -func (m *ProtocolMessage) GetKey() *MessageKey { - if m != nil { - return m.Key - } - return nil -} - -func (m *ProtocolMessage) GetType() ProtocolMessage_TYPE { - if m != nil && m.Type != nil { - return *m.Type - } - return ProtocolMessage_REVOKE -} - -type ContactsArrayMessage struct { - DisplayName *string `protobuf:"bytes,1,opt,name=displayName" json:"displayName,omitempty"` - Contacts []*ContactMessage `protobuf:"bytes,2,rep,name=contacts" json:"contacts,omitempty"` - ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ContactsArrayMessage) Reset() { *m = ContactsArrayMessage{} } -func (m *ContactsArrayMessage) String() string { return proto.CompactTextString(m) } -func (*ContactsArrayMessage) ProtoMessage() {} -func (*ContactsArrayMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{14} -} -func (m *ContactsArrayMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ContactsArrayMessage.Unmarshal(m, b) -} -func (m *ContactsArrayMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ContactsArrayMessage.Marshal(b, m, deterministic) -} -func (dst *ContactsArrayMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContactsArrayMessage.Merge(dst, src) -} -func (m *ContactsArrayMessage) XXX_Size() int { - return xxx_messageInfo_ContactsArrayMessage.Size(m) -} -func (m *ContactsArrayMessage) XXX_DiscardUnknown() { - xxx_messageInfo_ContactsArrayMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_ContactsArrayMessage proto.InternalMessageInfo - -func (m *ContactsArrayMessage) GetDisplayName() string { - if m != nil && m.DisplayName != nil { - return *m.DisplayName - } - return "" -} - -func (m *ContactsArrayMessage) GetContacts() []*ContactMessage { - if m != nil { - return m.Contacts - } - return nil -} - -func (m *ContactsArrayMessage) GetContextInfo() *ContextInfo { - if m != nil { - return m.ContextInfo - } - return nil -} - -type HSMCurrency struct { - CurrencyCode *string `protobuf:"bytes,1,opt,name=currencyCode" json:"currencyCode,omitempty"` - Amount1000 *int64 `protobuf:"varint,2,opt,name=amount1000" json:"amount1000,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HSMCurrency) Reset() { *m = HSMCurrency{} } -func (m *HSMCurrency) String() string { return proto.CompactTextString(m) } -func (*HSMCurrency) ProtoMessage() {} -func (*HSMCurrency) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{15} -} -func (m *HSMCurrency) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HSMCurrency.Unmarshal(m, b) -} -func (m *HSMCurrency) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HSMCurrency.Marshal(b, m, deterministic) -} -func (dst *HSMCurrency) XXX_Merge(src proto.Message) { - xxx_messageInfo_HSMCurrency.Merge(dst, src) -} -func (m *HSMCurrency) XXX_Size() int { - return xxx_messageInfo_HSMCurrency.Size(m) -} -func (m *HSMCurrency) XXX_DiscardUnknown() { - xxx_messageInfo_HSMCurrency.DiscardUnknown(m) -} - -var xxx_messageInfo_HSMCurrency proto.InternalMessageInfo - -func (m *HSMCurrency) GetCurrencyCode() string { - if m != nil && m.CurrencyCode != nil { - return *m.CurrencyCode - } - return "" -} - -func (m *HSMCurrency) GetAmount1000() int64 { - if m != nil && m.Amount1000 != nil { - return *m.Amount1000 - } - return 0 -} - -type HSMDateTimeComponent struct { - DayOfWeek *HSMDateTimeComponent_DAYOFWEEKTYPE `protobuf:"varint,1,opt,name=dayOfWeek,enum=proto.HSMDateTimeComponent_DAYOFWEEKTYPE" json:"dayOfWeek,omitempty"` - Year *uint32 `protobuf:"varint,2,opt,name=year" json:"year,omitempty"` - Month *uint32 `protobuf:"varint,3,opt,name=month" json:"month,omitempty"` - DayOfMonth *uint32 `protobuf:"varint,4,opt,name=dayOfMonth" json:"dayOfMonth,omitempty"` - Hour *uint32 `protobuf:"varint,5,opt,name=hour" json:"hour,omitempty"` - Minute *uint32 `protobuf:"varint,6,opt,name=minute" json:"minute,omitempty"` - Calendar *HSMDateTimeComponent_CALENDARTYPE `protobuf:"varint,7,opt,name=calendar,enum=proto.HSMDateTimeComponent_CALENDARTYPE" json:"calendar,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HSMDateTimeComponent) Reset() { *m = HSMDateTimeComponent{} } -func (m *HSMDateTimeComponent) String() string { return proto.CompactTextString(m) } -func (*HSMDateTimeComponent) ProtoMessage() {} -func (*HSMDateTimeComponent) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{16} -} -func (m *HSMDateTimeComponent) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HSMDateTimeComponent.Unmarshal(m, b) -} -func (m *HSMDateTimeComponent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HSMDateTimeComponent.Marshal(b, m, deterministic) -} -func (dst *HSMDateTimeComponent) XXX_Merge(src proto.Message) { - xxx_messageInfo_HSMDateTimeComponent.Merge(dst, src) -} -func (m *HSMDateTimeComponent) XXX_Size() int { - return xxx_messageInfo_HSMDateTimeComponent.Size(m) -} -func (m *HSMDateTimeComponent) XXX_DiscardUnknown() { - xxx_messageInfo_HSMDateTimeComponent.DiscardUnknown(m) -} - -var xxx_messageInfo_HSMDateTimeComponent proto.InternalMessageInfo - -func (m *HSMDateTimeComponent) GetDayOfWeek() HSMDateTimeComponent_DAYOFWEEKTYPE { - if m != nil && m.DayOfWeek != nil { - return *m.DayOfWeek - } - return HSMDateTimeComponent_MONDAY -} - -func (m *HSMDateTimeComponent) GetYear() uint32 { - if m != nil && m.Year != nil { - return *m.Year - } - return 0 -} - -func (m *HSMDateTimeComponent) GetMonth() uint32 { - if m != nil && m.Month != nil { - return *m.Month - } - return 0 -} - -func (m *HSMDateTimeComponent) GetDayOfMonth() uint32 { - if m != nil && m.DayOfMonth != nil { - return *m.DayOfMonth - } - return 0 -} - -func (m *HSMDateTimeComponent) GetHour() uint32 { - if m != nil && m.Hour != nil { - return *m.Hour - } - return 0 -} - -func (m *HSMDateTimeComponent) GetMinute() uint32 { - if m != nil && m.Minute != nil { - return *m.Minute - } - return 0 -} - -func (m *HSMDateTimeComponent) GetCalendar() HSMDateTimeComponent_CALENDARTYPE { - if m != nil && m.Calendar != nil { - return *m.Calendar - } - return HSMDateTimeComponent_GREGORIAN -} - -type HSMDateTimeUnixEpoch struct { - Timestamp *int64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HSMDateTimeUnixEpoch) Reset() { *m = HSMDateTimeUnixEpoch{} } -func (m *HSMDateTimeUnixEpoch) String() string { return proto.CompactTextString(m) } -func (*HSMDateTimeUnixEpoch) ProtoMessage() {} -func (*HSMDateTimeUnixEpoch) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{17} -} -func (m *HSMDateTimeUnixEpoch) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HSMDateTimeUnixEpoch.Unmarshal(m, b) -} -func (m *HSMDateTimeUnixEpoch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HSMDateTimeUnixEpoch.Marshal(b, m, deterministic) -} -func (dst *HSMDateTimeUnixEpoch) XXX_Merge(src proto.Message) { - xxx_messageInfo_HSMDateTimeUnixEpoch.Merge(dst, src) -} -func (m *HSMDateTimeUnixEpoch) XXX_Size() int { - return xxx_messageInfo_HSMDateTimeUnixEpoch.Size(m) -} -func (m *HSMDateTimeUnixEpoch) XXX_DiscardUnknown() { - xxx_messageInfo_HSMDateTimeUnixEpoch.DiscardUnknown(m) -} - -var xxx_messageInfo_HSMDateTimeUnixEpoch proto.InternalMessageInfo - -func (m *HSMDateTimeUnixEpoch) GetTimestamp() int64 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -type HSMDateTime struct { - // Types that are valid to be assigned to DatetimeOneof: - // *HSMDateTime_Component - // *HSMDateTime_UnixEpoch - DatetimeOneof isHSMDateTime_DatetimeOneof `protobuf_oneof:"datetimeOneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HSMDateTime) Reset() { *m = HSMDateTime{} } -func (m *HSMDateTime) String() string { return proto.CompactTextString(m) } -func (*HSMDateTime) ProtoMessage() {} -func (*HSMDateTime) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{18} -} -func (m *HSMDateTime) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HSMDateTime.Unmarshal(m, b) -} -func (m *HSMDateTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HSMDateTime.Marshal(b, m, deterministic) -} -func (dst *HSMDateTime) XXX_Merge(src proto.Message) { - xxx_messageInfo_HSMDateTime.Merge(dst, src) -} -func (m *HSMDateTime) XXX_Size() int { - return xxx_messageInfo_HSMDateTime.Size(m) -} -func (m *HSMDateTime) XXX_DiscardUnknown() { - xxx_messageInfo_HSMDateTime.DiscardUnknown(m) -} - -var xxx_messageInfo_HSMDateTime proto.InternalMessageInfo - -type isHSMDateTime_DatetimeOneof interface { - isHSMDateTime_DatetimeOneof() -} - -type HSMDateTime_Component struct { - Component *HSMDateTimeComponent `protobuf:"bytes,1,opt,name=component,oneof"` -} -type HSMDateTime_UnixEpoch struct { - UnixEpoch *HSMDateTimeUnixEpoch `protobuf:"bytes,2,opt,name=unixEpoch,oneof"` -} - -func (*HSMDateTime_Component) isHSMDateTime_DatetimeOneof() {} -func (*HSMDateTime_UnixEpoch) isHSMDateTime_DatetimeOneof() {} - -func (m *HSMDateTime) GetDatetimeOneof() isHSMDateTime_DatetimeOneof { - if m != nil { - return m.DatetimeOneof - } - return nil -} - -func (m *HSMDateTime) GetComponent() *HSMDateTimeComponent { - if x, ok := m.GetDatetimeOneof().(*HSMDateTime_Component); ok { - return x.Component - } - return nil -} - -func (m *HSMDateTime) GetUnixEpoch() *HSMDateTimeUnixEpoch { - if x, ok := m.GetDatetimeOneof().(*HSMDateTime_UnixEpoch); ok { - return x.UnixEpoch - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*HSMDateTime) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _HSMDateTime_OneofMarshaler, _HSMDateTime_OneofUnmarshaler, _HSMDateTime_OneofSizer, []interface{}{ - (*HSMDateTime_Component)(nil), - (*HSMDateTime_UnixEpoch)(nil), - } -} - -func _HSMDateTime_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*HSMDateTime) - // datetimeOneof - switch x := m.DatetimeOneof.(type) { - case *HSMDateTime_Component: - b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Component); err != nil { - return err - } - case *HSMDateTime_UnixEpoch: - b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.UnixEpoch); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("HSMDateTime.DatetimeOneof has unexpected type %T", x) - } - return nil -} - -func _HSMDateTime_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*HSMDateTime) - switch tag { - case 1: // datetimeOneof.component - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HSMDateTimeComponent) - err := b.DecodeMessage(msg) - m.DatetimeOneof = &HSMDateTime_Component{msg} - return true, err - case 2: // datetimeOneof.unixEpoch - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HSMDateTimeUnixEpoch) - err := b.DecodeMessage(msg) - m.DatetimeOneof = &HSMDateTime_UnixEpoch{msg} - return true, err - default: - return false, nil - } -} - -func _HSMDateTime_OneofSizer(msg proto.Message) (n int) { - m := msg.(*HSMDateTime) - // datetimeOneof - switch x := m.DatetimeOneof.(type) { - case *HSMDateTime_Component: - s := proto.Size(x.Component) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *HSMDateTime_UnixEpoch: - s := proto.Size(x.UnixEpoch) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -type HSMLocalizableParameter struct { - Default *string `protobuf:"bytes,1,opt,name=default" json:"default,omitempty"` - // Types that are valid to be assigned to ParamOneof: - // *HSMLocalizableParameter_Currency - // *HSMLocalizableParameter_DateTime - ParamOneof isHSMLocalizableParameter_ParamOneof `protobuf_oneof:"paramOneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HSMLocalizableParameter) Reset() { *m = HSMLocalizableParameter{} } -func (m *HSMLocalizableParameter) String() string { return proto.CompactTextString(m) } -func (*HSMLocalizableParameter) ProtoMessage() {} -func (*HSMLocalizableParameter) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{19} -} -func (m *HSMLocalizableParameter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HSMLocalizableParameter.Unmarshal(m, b) -} -func (m *HSMLocalizableParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HSMLocalizableParameter.Marshal(b, m, deterministic) -} -func (dst *HSMLocalizableParameter) XXX_Merge(src proto.Message) { - xxx_messageInfo_HSMLocalizableParameter.Merge(dst, src) -} -func (m *HSMLocalizableParameter) XXX_Size() int { - return xxx_messageInfo_HSMLocalizableParameter.Size(m) -} -func (m *HSMLocalizableParameter) XXX_DiscardUnknown() { - xxx_messageInfo_HSMLocalizableParameter.DiscardUnknown(m) -} - -var xxx_messageInfo_HSMLocalizableParameter proto.InternalMessageInfo - -type isHSMLocalizableParameter_ParamOneof interface { - isHSMLocalizableParameter_ParamOneof() -} - -type HSMLocalizableParameter_Currency struct { - Currency *HSMCurrency `protobuf:"bytes,2,opt,name=currency,oneof"` -} -type HSMLocalizableParameter_DateTime struct { - DateTime *HSMDateTime `protobuf:"bytes,3,opt,name=dateTime,oneof"` -} - -func (*HSMLocalizableParameter_Currency) isHSMLocalizableParameter_ParamOneof() {} -func (*HSMLocalizableParameter_DateTime) isHSMLocalizableParameter_ParamOneof() {} - -func (m *HSMLocalizableParameter) GetParamOneof() isHSMLocalizableParameter_ParamOneof { - if m != nil { - return m.ParamOneof - } - return nil -} - -func (m *HSMLocalizableParameter) GetDefault() string { - if m != nil && m.Default != nil { - return *m.Default - } - return "" -} - -func (m *HSMLocalizableParameter) GetCurrency() *HSMCurrency { - if x, ok := m.GetParamOneof().(*HSMLocalizableParameter_Currency); ok { - return x.Currency - } - return nil -} - -func (m *HSMLocalizableParameter) GetDateTime() *HSMDateTime { - if x, ok := m.GetParamOneof().(*HSMLocalizableParameter_DateTime); ok { - return x.DateTime - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*HSMLocalizableParameter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _HSMLocalizableParameter_OneofMarshaler, _HSMLocalizableParameter_OneofUnmarshaler, _HSMLocalizableParameter_OneofSizer, []interface{}{ - (*HSMLocalizableParameter_Currency)(nil), - (*HSMLocalizableParameter_DateTime)(nil), - } -} - -func _HSMLocalizableParameter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*HSMLocalizableParameter) - // paramOneof - switch x := m.ParamOneof.(type) { - case *HSMLocalizableParameter_Currency: - b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Currency); err != nil { - return err - } - case *HSMLocalizableParameter_DateTime: - b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.DateTime); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("HSMLocalizableParameter.ParamOneof has unexpected type %T", x) - } - return nil -} - -func _HSMLocalizableParameter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*HSMLocalizableParameter) - switch tag { - case 2: // paramOneof.currency - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HSMCurrency) - err := b.DecodeMessage(msg) - m.ParamOneof = &HSMLocalizableParameter_Currency{msg} - return true, err - case 3: // paramOneof.dateTime - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HSMDateTime) - err := b.DecodeMessage(msg) - m.ParamOneof = &HSMLocalizableParameter_DateTime{msg} - return true, err - default: - return false, nil - } -} - -func _HSMLocalizableParameter_OneofSizer(msg proto.Message) (n int) { - m := msg.(*HSMLocalizableParameter) - // paramOneof - switch x := m.ParamOneof.(type) { - case *HSMLocalizableParameter_Currency: - s := proto.Size(x.Currency) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *HSMLocalizableParameter_DateTime: - s := proto.Size(x.DateTime) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -type HighlyStructuredMessage struct { - Namespace *string `protobuf:"bytes,1,opt,name=namespace" json:"namespace,omitempty"` - ElementName *string `protobuf:"bytes,2,opt,name=elementName" json:"elementName,omitempty"` - Params []string `protobuf:"bytes,3,rep,name=params" json:"params,omitempty"` - FallbackLg *string `protobuf:"bytes,4,opt,name=fallbackLg" json:"fallbackLg,omitempty"` - FallbackLc *string `protobuf:"bytes,5,opt,name=fallbackLc" json:"fallbackLc,omitempty"` - LocalizableParams []*HSMLocalizableParameter `protobuf:"bytes,6,rep,name=localizableParams" json:"localizableParams,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HighlyStructuredMessage) Reset() { *m = HighlyStructuredMessage{} } -func (m *HighlyStructuredMessage) String() string { return proto.CompactTextString(m) } -func (*HighlyStructuredMessage) ProtoMessage() {} -func (*HighlyStructuredMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{20} -} -func (m *HighlyStructuredMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HighlyStructuredMessage.Unmarshal(m, b) -} -func (m *HighlyStructuredMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HighlyStructuredMessage.Marshal(b, m, deterministic) -} -func (dst *HighlyStructuredMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_HighlyStructuredMessage.Merge(dst, src) -} -func (m *HighlyStructuredMessage) XXX_Size() int { - return xxx_messageInfo_HighlyStructuredMessage.Size(m) -} -func (m *HighlyStructuredMessage) XXX_DiscardUnknown() { - xxx_messageInfo_HighlyStructuredMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_HighlyStructuredMessage proto.InternalMessageInfo - -func (m *HighlyStructuredMessage) GetNamespace() string { - if m != nil && m.Namespace != nil { - return *m.Namespace - } - return "" -} - -func (m *HighlyStructuredMessage) GetElementName() string { - if m != nil && m.ElementName != nil { - return *m.ElementName - } - return "" -} - -func (m *HighlyStructuredMessage) GetParams() []string { - if m != nil { - return m.Params - } - return nil -} - -func (m *HighlyStructuredMessage) GetFallbackLg() string { - if m != nil && m.FallbackLg != nil { - return *m.FallbackLg - } - return "" -} - -func (m *HighlyStructuredMessage) GetFallbackLc() string { - if m != nil && m.FallbackLc != nil { - return *m.FallbackLc - } - return "" -} - -func (m *HighlyStructuredMessage) GetLocalizableParams() []*HSMLocalizableParameter { - if m != nil { - return m.LocalizableParams - } - return nil -} - -type SendPaymentMessage struct { - NoteMessage *Message `protobuf:"bytes,2,opt,name=noteMessage" json:"noteMessage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SendPaymentMessage) Reset() { *m = SendPaymentMessage{} } -func (m *SendPaymentMessage) String() string { return proto.CompactTextString(m) } -func (*SendPaymentMessage) ProtoMessage() {} -func (*SendPaymentMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{21} -} -func (m *SendPaymentMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SendPaymentMessage.Unmarshal(m, b) -} -func (m *SendPaymentMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SendPaymentMessage.Marshal(b, m, deterministic) -} -func (dst *SendPaymentMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_SendPaymentMessage.Merge(dst, src) -} -func (m *SendPaymentMessage) XXX_Size() int { - return xxx_messageInfo_SendPaymentMessage.Size(m) -} -func (m *SendPaymentMessage) XXX_DiscardUnknown() { - xxx_messageInfo_SendPaymentMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_SendPaymentMessage proto.InternalMessageInfo - -func (m *SendPaymentMessage) GetNoteMessage() *Message { - if m != nil { - return m.NoteMessage - } - return nil -} - -type RequestPaymentMessage struct { - CurrencyCodeIso4217 *string `protobuf:"bytes,1,opt,name=currencyCodeIso4217" json:"currencyCodeIso4217,omitempty"` - Amount1000 *uint64 `protobuf:"varint,2,opt,name=amount1000" json:"amount1000,omitempty"` - RequestFrom *string `protobuf:"bytes,3,opt,name=requestFrom" json:"requestFrom,omitempty"` - NoteMessage *Message `protobuf:"bytes,4,opt,name=noteMessage" json:"noteMessage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RequestPaymentMessage) Reset() { *m = RequestPaymentMessage{} } -func (m *RequestPaymentMessage) String() string { return proto.CompactTextString(m) } -func (*RequestPaymentMessage) ProtoMessage() {} -func (*RequestPaymentMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{22} -} -func (m *RequestPaymentMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RequestPaymentMessage.Unmarshal(m, b) -} -func (m *RequestPaymentMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RequestPaymentMessage.Marshal(b, m, deterministic) -} -func (dst *RequestPaymentMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestPaymentMessage.Merge(dst, src) -} -func (m *RequestPaymentMessage) XXX_Size() int { - return xxx_messageInfo_RequestPaymentMessage.Size(m) -} -func (m *RequestPaymentMessage) XXX_DiscardUnknown() { - xxx_messageInfo_RequestPaymentMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestPaymentMessage proto.InternalMessageInfo - -func (m *RequestPaymentMessage) GetCurrencyCodeIso4217() string { - if m != nil && m.CurrencyCodeIso4217 != nil { - return *m.CurrencyCodeIso4217 - } - return "" -} - -func (m *RequestPaymentMessage) GetAmount1000() uint64 { - if m != nil && m.Amount1000 != nil { - return *m.Amount1000 - } - return 0 -} - -func (m *RequestPaymentMessage) GetRequestFrom() string { - if m != nil && m.RequestFrom != nil { - return *m.RequestFrom - } - return "" -} - -func (m *RequestPaymentMessage) GetNoteMessage() *Message { - if m != nil { - return m.NoteMessage - } - return nil -} - -type LiveLocationMessage struct { - DegreesLatitude *float64 `protobuf:"fixed64,1,opt,name=degreesLatitude" json:"degreesLatitude,omitempty"` - DegreesLongitude *float64 `protobuf:"fixed64,2,opt,name=degreesLongitude" json:"degreesLongitude,omitempty"` - AccuracyInMeters *uint32 `protobuf:"varint,3,opt,name=accuracyInMeters" json:"accuracyInMeters,omitempty"` - SpeedInMps *float32 `protobuf:"fixed32,4,opt,name=speedInMps" json:"speedInMps,omitempty"` - DegreesClockwiseFromMagneticNorth *uint32 `protobuf:"varint,5,opt,name=degreesClockwiseFromMagneticNorth" json:"degreesClockwiseFromMagneticNorth,omitempty"` - Caption *string `protobuf:"bytes,6,opt,name=caption" json:"caption,omitempty"` - SequenceNumber *int64 `protobuf:"varint,7,opt,name=sequenceNumber" json:"sequenceNumber,omitempty"` - JpegThumbnail []byte `protobuf:"bytes,16,opt,name=jpegThumbnail" json:"jpegThumbnail,omitempty"` - ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LiveLocationMessage) Reset() { *m = LiveLocationMessage{} } -func (m *LiveLocationMessage) String() string { return proto.CompactTextString(m) } -func (*LiveLocationMessage) ProtoMessage() {} -func (*LiveLocationMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{23} -} -func (m *LiveLocationMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LiveLocationMessage.Unmarshal(m, b) -} -func (m *LiveLocationMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LiveLocationMessage.Marshal(b, m, deterministic) -} -func (dst *LiveLocationMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_LiveLocationMessage.Merge(dst, src) -} -func (m *LiveLocationMessage) XXX_Size() int { - return xxx_messageInfo_LiveLocationMessage.Size(m) -} -func (m *LiveLocationMessage) XXX_DiscardUnknown() { - xxx_messageInfo_LiveLocationMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_LiveLocationMessage proto.InternalMessageInfo - -func (m *LiveLocationMessage) GetDegreesLatitude() float64 { - if m != nil && m.DegreesLatitude != nil { - return *m.DegreesLatitude - } - return 0 -} - -func (m *LiveLocationMessage) GetDegreesLongitude() float64 { - if m != nil && m.DegreesLongitude != nil { - return *m.DegreesLongitude - } - return 0 -} - -func (m *LiveLocationMessage) GetAccuracyInMeters() uint32 { - if m != nil && m.AccuracyInMeters != nil { - return *m.AccuracyInMeters - } - return 0 -} - -func (m *LiveLocationMessage) GetSpeedInMps() float32 { - if m != nil && m.SpeedInMps != nil { - return *m.SpeedInMps - } - return 0 -} - -func (m *LiveLocationMessage) GetDegreesClockwiseFromMagneticNorth() uint32 { - if m != nil && m.DegreesClockwiseFromMagneticNorth != nil { - return *m.DegreesClockwiseFromMagneticNorth - } - return 0 -} - -func (m *LiveLocationMessage) GetCaption() string { - if m != nil && m.Caption != nil { - return *m.Caption - } - return "" -} - -func (m *LiveLocationMessage) GetSequenceNumber() int64 { - if m != nil && m.SequenceNumber != nil { - return *m.SequenceNumber - } - return 0 -} - -func (m *LiveLocationMessage) GetJpegThumbnail() []byte { - if m != nil { - return m.JpegThumbnail - } - return nil -} - -func (m *LiveLocationMessage) GetContextInfo() *ContextInfo { - if m != nil { - return m.ContextInfo - } - return nil -} - -type StickerMessage struct { - Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` - FileSha256 []byte `protobuf:"bytes,2,opt,name=fileSha256" json:"fileSha256,omitempty"` - FileEncSha256 []byte `protobuf:"bytes,3,opt,name=fileEncSha256" json:"fileEncSha256,omitempty"` - MediaKey []byte `protobuf:"bytes,4,opt,name=mediaKey" json:"mediaKey,omitempty"` - Mimetype *string `protobuf:"bytes,5,opt,name=mimetype" json:"mimetype,omitempty"` - Height *uint32 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` - Width *uint32 `protobuf:"varint,7,opt,name=width" json:"width,omitempty"` - DirectPath *string `protobuf:"bytes,8,opt,name=directPath" json:"directPath,omitempty"` - FileLength *uint64 `protobuf:"varint,9,opt,name=fileLength" json:"fileLength,omitempty"` - PngThumbnail []byte `protobuf:"bytes,16,opt,name=pngThumbnail" json:"pngThumbnail,omitempty"` - ContextInfo *ContextInfo `protobuf:"bytes,17,opt,name=contextInfo" json:"contextInfo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StickerMessage) Reset() { *m = StickerMessage{} } -func (m *StickerMessage) String() string { return proto.CompactTextString(m) } -func (*StickerMessage) ProtoMessage() {} -func (*StickerMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{24} -} -func (m *StickerMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StickerMessage.Unmarshal(m, b) -} -func (m *StickerMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StickerMessage.Marshal(b, m, deterministic) -} -func (dst *StickerMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_StickerMessage.Merge(dst, src) -} -func (m *StickerMessage) XXX_Size() int { - return xxx_messageInfo_StickerMessage.Size(m) -} -func (m *StickerMessage) XXX_DiscardUnknown() { - xxx_messageInfo_StickerMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_StickerMessage proto.InternalMessageInfo - -func (m *StickerMessage) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *StickerMessage) GetFileSha256() []byte { - if m != nil { - return m.FileSha256 - } - return nil -} - -func (m *StickerMessage) GetFileEncSha256() []byte { - if m != nil { - return m.FileEncSha256 - } - return nil -} - -func (m *StickerMessage) GetMediaKey() []byte { - if m != nil { - return m.MediaKey - } - return nil -} - -func (m *StickerMessage) GetMimetype() string { - if m != nil && m.Mimetype != nil { - return *m.Mimetype - } - return "" -} - -func (m *StickerMessage) GetHeight() uint32 { - if m != nil && m.Height != nil { - return *m.Height - } - return 0 -} - -func (m *StickerMessage) GetWidth() uint32 { - if m != nil && m.Width != nil { - return *m.Width - } - return 0 -} - -func (m *StickerMessage) GetDirectPath() string { - if m != nil && m.DirectPath != nil { - return *m.DirectPath - } - return "" -} - -func (m *StickerMessage) GetFileLength() uint64 { - if m != nil && m.FileLength != nil { - return *m.FileLength - } - return 0 -} - -func (m *StickerMessage) GetPngThumbnail() []byte { - if m != nil { - return m.PngThumbnail - } - return nil -} - -func (m *StickerMessage) GetContextInfo() *ContextInfo { - if m != nil { - return m.ContextInfo - } - return nil -} - -type Message struct { - Conversation *string `protobuf:"bytes,1,opt,name=conversation" json:"conversation,omitempty"` - SenderKeyDistributionMessage *SenderKeyDistributionMessage `protobuf:"bytes,2,opt,name=senderKeyDistributionMessage" json:"senderKeyDistributionMessage,omitempty"` - ImageMessage *ImageMessage `protobuf:"bytes,3,opt,name=imageMessage" json:"imageMessage,omitempty"` - ContactMessage *ContactMessage `protobuf:"bytes,4,opt,name=contactMessage" json:"contactMessage,omitempty"` - LocationMessage *LocationMessage `protobuf:"bytes,5,opt,name=locationMessage" json:"locationMessage,omitempty"` - ExtendedTextMessage *ExtendedTextMessage `protobuf:"bytes,6,opt,name=extendedTextMessage" json:"extendedTextMessage,omitempty"` - DocumentMessage *DocumentMessage `protobuf:"bytes,7,opt,name=documentMessage" json:"documentMessage,omitempty"` - AudioMessage *AudioMessage `protobuf:"bytes,8,opt,name=audioMessage" json:"audioMessage,omitempty"` - VideoMessage *VideoMessage `protobuf:"bytes,9,opt,name=videoMessage" json:"videoMessage,omitempty"` - Call *Call `protobuf:"bytes,10,opt,name=call" json:"call,omitempty"` - Chat *Chat `protobuf:"bytes,11,opt,name=chat" json:"chat,omitempty"` - ProtocolMessage *ProtocolMessage `protobuf:"bytes,12,opt,name=protocolMessage" json:"protocolMessage,omitempty"` - ContactsArrayMessage *ContactsArrayMessage `protobuf:"bytes,13,opt,name=contactsArrayMessage" json:"contactsArrayMessage,omitempty"` - HighlyStructuredMessage *HighlyStructuredMessage `protobuf:"bytes,14,opt,name=highlyStructuredMessage" json:"highlyStructuredMessage,omitempty"` - FastRatchetKeySenderKeyDistributionMessage *SenderKeyDistributionMessage `protobuf:"bytes,15,opt,name=fastRatchetKeySenderKeyDistributionMessage" json:"fastRatchetKeySenderKeyDistributionMessage,omitempty"` - SendPaymentMessage *SendPaymentMessage `protobuf:"bytes,16,opt,name=sendPaymentMessage" json:"sendPaymentMessage,omitempty"` - RequestPaymentMessage *RequestPaymentMessage `protobuf:"bytes,17,opt,name=requestPaymentMessage" json:"requestPaymentMessage,omitempty"` - LiveLocationMessage *LiveLocationMessage `protobuf:"bytes,18,opt,name=liveLocationMessage" json:"liveLocationMessage,omitempty"` - StickerMessage *StickerMessage `protobuf:"bytes,20,opt,name=stickerMessage" json:"stickerMessage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{25} -} -func (m *Message) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Message.Unmarshal(m, b) -} -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) -} -func (dst *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(dst, src) -} -func (m *Message) XXX_Size() int { - return xxx_messageInfo_Message.Size(m) -} -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -func (m *Message) GetConversation() string { - if m != nil && m.Conversation != nil { - return *m.Conversation - } - return "" -} - -func (m *Message) GetSenderKeyDistributionMessage() *SenderKeyDistributionMessage { - if m != nil { - return m.SenderKeyDistributionMessage - } - return nil -} - -func (m *Message) GetImageMessage() *ImageMessage { - if m != nil { - return m.ImageMessage - } - return nil -} - -func (m *Message) GetContactMessage() *ContactMessage { - if m != nil { - return m.ContactMessage - } - return nil -} - -func (m *Message) GetLocationMessage() *LocationMessage { - if m != nil { - return m.LocationMessage - } - return nil -} - -func (m *Message) GetExtendedTextMessage() *ExtendedTextMessage { - if m != nil { - return m.ExtendedTextMessage - } - return nil -} - -func (m *Message) GetDocumentMessage() *DocumentMessage { - if m != nil { - return m.DocumentMessage - } - return nil -} - -func (m *Message) GetAudioMessage() *AudioMessage { - if m != nil { - return m.AudioMessage - } - return nil -} - -func (m *Message) GetVideoMessage() *VideoMessage { - if m != nil { - return m.VideoMessage - } - return nil -} - -func (m *Message) GetCall() *Call { - if m != nil { - return m.Call - } - return nil -} - -func (m *Message) GetChat() *Chat { - if m != nil { - return m.Chat - } - return nil -} - -func (m *Message) GetProtocolMessage() *ProtocolMessage { - if m != nil { - return m.ProtocolMessage - } - return nil -} - -func (m *Message) GetContactsArrayMessage() *ContactsArrayMessage { - if m != nil { - return m.ContactsArrayMessage - } - return nil -} - -func (m *Message) GetHighlyStructuredMessage() *HighlyStructuredMessage { - if m != nil { - return m.HighlyStructuredMessage - } - return nil -} - -func (m *Message) GetFastRatchetKeySenderKeyDistributionMessage() *SenderKeyDistributionMessage { - if m != nil { - return m.FastRatchetKeySenderKeyDistributionMessage - } - return nil -} - -func (m *Message) GetSendPaymentMessage() *SendPaymentMessage { - if m != nil { - return m.SendPaymentMessage - } - return nil -} - -func (m *Message) GetRequestPaymentMessage() *RequestPaymentMessage { - if m != nil { - return m.RequestPaymentMessage - } - return nil -} - -func (m *Message) GetLiveLocationMessage() *LiveLocationMessage { - if m != nil { - return m.LiveLocationMessage - } - return nil -} - -func (m *Message) GetStickerMessage() *StickerMessage { - if m != nil { - return m.StickerMessage - } - return nil -} - -type ContextInfo struct { - StanzaId *string `protobuf:"bytes,1,opt,name=stanzaId" json:"stanzaId,omitempty"` - Participant *string `protobuf:"bytes,2,opt,name=participant" json:"participant,omitempty"` - QuotedMessage []*Message `protobuf:"bytes,3,rep,name=quotedMessage" json:"quotedMessage,omitempty"` - RemoteJid *string `protobuf:"bytes,4,opt,name=remoteJid" json:"remoteJid,omitempty"` - MentionedJid []string `protobuf:"bytes,15,rep,name=mentionedJid" json:"mentionedJid,omitempty"` - ConversionSource *string `protobuf:"bytes,18,opt,name=conversionSource" json:"conversionSource,omitempty"` - ConversionData []byte `protobuf:"bytes,19,opt,name=conversionData" json:"conversionData,omitempty"` - ConversionDelaySeconds *uint32 `protobuf:"varint,20,opt,name=conversionDelaySeconds" json:"conversionDelaySeconds,omitempty"` - IsForwarded *bool `protobuf:"varint,22,opt,name=isForwarded" json:"isForwarded,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ContextInfo) Reset() { *m = ContextInfo{} } -func (m *ContextInfo) String() string { return proto.CompactTextString(m) } -func (*ContextInfo) ProtoMessage() {} -func (*ContextInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{26} -} -func (m *ContextInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ContextInfo.Unmarshal(m, b) -} -func (m *ContextInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ContextInfo.Marshal(b, m, deterministic) -} -func (dst *ContextInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContextInfo.Merge(dst, src) -} -func (m *ContextInfo) XXX_Size() int { - return xxx_messageInfo_ContextInfo.Size(m) -} -func (m *ContextInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ContextInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ContextInfo proto.InternalMessageInfo - -func (m *ContextInfo) GetStanzaId() string { - if m != nil && m.StanzaId != nil { - return *m.StanzaId - } - return "" -} - -func (m *ContextInfo) GetParticipant() string { - if m != nil && m.Participant != nil { - return *m.Participant - } - return "" -} - -func (m *ContextInfo) GetQuotedMessage() []*Message { - if m != nil { - return m.QuotedMessage - } - return nil -} - -func (m *ContextInfo) GetRemoteJid() string { - if m != nil && m.RemoteJid != nil { - return *m.RemoteJid - } - return "" -} - -func (m *ContextInfo) GetMentionedJid() []string { - if m != nil { - return m.MentionedJid - } - return nil -} - -func (m *ContextInfo) GetConversionSource() string { - if m != nil && m.ConversionSource != nil { - return *m.ConversionSource - } - return "" -} - -func (m *ContextInfo) GetConversionData() []byte { - if m != nil { - return m.ConversionData - } - return nil -} - -func (m *ContextInfo) GetConversionDelaySeconds() uint32 { - if m != nil && m.ConversionDelaySeconds != nil { - return *m.ConversionDelaySeconds - } - return 0 -} - -func (m *ContextInfo) GetIsForwarded() bool { - if m != nil && m.IsForwarded != nil { - return *m.IsForwarded - } - return false -} - -type InteractiveAnnotation struct { - PolygonVertices []*Point `protobuf:"bytes,1,rep,name=polygonVertices" json:"polygonVertices,omitempty"` - // Types that are valid to be assigned to Action: - // *InteractiveAnnotation_Location - Action isInteractiveAnnotation_Action `protobuf_oneof:"action"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InteractiveAnnotation) Reset() { *m = InteractiveAnnotation{} } -func (m *InteractiveAnnotation) String() string { return proto.CompactTextString(m) } -func (*InteractiveAnnotation) ProtoMessage() {} -func (*InteractiveAnnotation) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{27} -} -func (m *InteractiveAnnotation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InteractiveAnnotation.Unmarshal(m, b) -} -func (m *InteractiveAnnotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InteractiveAnnotation.Marshal(b, m, deterministic) -} -func (dst *InteractiveAnnotation) XXX_Merge(src proto.Message) { - xxx_messageInfo_InteractiveAnnotation.Merge(dst, src) -} -func (m *InteractiveAnnotation) XXX_Size() int { - return xxx_messageInfo_InteractiveAnnotation.Size(m) -} -func (m *InteractiveAnnotation) XXX_DiscardUnknown() { - xxx_messageInfo_InteractiveAnnotation.DiscardUnknown(m) -} - -var xxx_messageInfo_InteractiveAnnotation proto.InternalMessageInfo - -type isInteractiveAnnotation_Action interface { - isInteractiveAnnotation_Action() -} - -type InteractiveAnnotation_Location struct { - Location *Location `protobuf:"bytes,2,opt,name=location,oneof"` -} - -func (*InteractiveAnnotation_Location) isInteractiveAnnotation_Action() {} - -func (m *InteractiveAnnotation) GetAction() isInteractiveAnnotation_Action { - if m != nil { - return m.Action - } - return nil -} - -func (m *InteractiveAnnotation) GetPolygonVertices() []*Point { - if m != nil { - return m.PolygonVertices - } - return nil -} - -func (m *InteractiveAnnotation) GetLocation() *Location { - if x, ok := m.GetAction().(*InteractiveAnnotation_Location); ok { - return x.Location - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*InteractiveAnnotation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _InteractiveAnnotation_OneofMarshaler, _InteractiveAnnotation_OneofUnmarshaler, _InteractiveAnnotation_OneofSizer, []interface{}{ - (*InteractiveAnnotation_Location)(nil), - } -} - -func _InteractiveAnnotation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*InteractiveAnnotation) - // action - switch x := m.Action.(type) { - case *InteractiveAnnotation_Location: - b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Location); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("InteractiveAnnotation.Action has unexpected type %T", x) - } - return nil -} - -func _InteractiveAnnotation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*InteractiveAnnotation) - switch tag { - case 2: // action.location - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Location) - err := b.DecodeMessage(msg) - m.Action = &InteractiveAnnotation_Location{msg} - return true, err - default: - return false, nil - } -} - -func _InteractiveAnnotation_OneofSizer(msg proto.Message) (n int) { - m := msg.(*InteractiveAnnotation) - // action - switch x := m.Action.(type) { - case *InteractiveAnnotation_Location: - s := proto.Size(x.Location) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -type Point struct { - X *float64 `protobuf:"fixed64,3,opt,name=x" json:"x,omitempty"` - Y *float64 `protobuf:"fixed64,4,opt,name=y" json:"y,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Point) Reset() { *m = Point{} } -func (m *Point) String() string { return proto.CompactTextString(m) } -func (*Point) ProtoMessage() {} -func (*Point) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{28} -} -func (m *Point) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Point.Unmarshal(m, b) -} -func (m *Point) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Point.Marshal(b, m, deterministic) -} -func (dst *Point) XXX_Merge(src proto.Message) { - xxx_messageInfo_Point.Merge(dst, src) -} -func (m *Point) XXX_Size() int { - return xxx_messageInfo_Point.Size(m) -} -func (m *Point) XXX_DiscardUnknown() { - xxx_messageInfo_Point.DiscardUnknown(m) -} - -var xxx_messageInfo_Point proto.InternalMessageInfo - -func (m *Point) GetX() float64 { - if m != nil && m.X != nil { - return *m.X - } - return 0 -} - -func (m *Point) GetY() float64 { - if m != nil && m.Y != nil { - return *m.Y - } - return 0 -} - -type Location struct { - DegreesLatitude *float64 `protobuf:"fixed64,1,opt,name=degreesLatitude" json:"degreesLatitude,omitempty"` - DegreesLongitude *float64 `protobuf:"fixed64,2,opt,name=degreesLongitude" json:"degreesLongitude,omitempty"` - Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Location) Reset() { *m = Location{} } -func (m *Location) String() string { return proto.CompactTextString(m) } -func (*Location) ProtoMessage() {} -func (*Location) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{29} -} -func (m *Location) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Location.Unmarshal(m, b) -} -func (m *Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Location.Marshal(b, m, deterministic) -} -func (dst *Location) XXX_Merge(src proto.Message) { - xxx_messageInfo_Location.Merge(dst, src) -} -func (m *Location) XXX_Size() int { - return xxx_messageInfo_Location.Size(m) -} -func (m *Location) XXX_DiscardUnknown() { - xxx_messageInfo_Location.DiscardUnknown(m) -} - -var xxx_messageInfo_Location proto.InternalMessageInfo - -func (m *Location) GetDegreesLatitude() float64 { - if m != nil && m.DegreesLatitude != nil { - return *m.DegreesLatitude - } - return 0 -} - -func (m *Location) GetDegreesLongitude() float64 { - if m != nil && m.DegreesLongitude != nil { - return *m.DegreesLongitude - } - return 0 -} - -func (m *Location) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -type WebMessageInfo struct { - Key *MessageKey `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` - Message *Message `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - MessageTimestamp *uint64 `protobuf:"varint,3,opt,name=messageTimestamp" json:"messageTimestamp,omitempty"` - Status *WebMessageInfo_STATUS `protobuf:"varint,4,opt,name=status,enum=proto.WebMessageInfo_STATUS,def=1" json:"status,omitempty"` - Participant *string `protobuf:"bytes,5,opt,name=participant" json:"participant,omitempty"` - Ignore *bool `protobuf:"varint,16,opt,name=ignore" json:"ignore,omitempty"` - Starred *bool `protobuf:"varint,17,opt,name=starred" json:"starred,omitempty"` - Broadcast *bool `protobuf:"varint,18,opt,name=broadcast" json:"broadcast,omitempty"` - PushName *string `protobuf:"bytes,19,opt,name=pushName" json:"pushName,omitempty"` - MediaCiphertextSha256 []byte `protobuf:"bytes,20,opt,name=mediaCiphertextSha256" json:"mediaCiphertextSha256,omitempty"` - Multicast *bool `protobuf:"varint,21,opt,name=multicast" json:"multicast,omitempty"` - UrlText *bool `protobuf:"varint,22,opt,name=urlText" json:"urlText,omitempty"` - UrlNumber *bool `protobuf:"varint,23,opt,name=urlNumber" json:"urlNumber,omitempty"` - MessageStubType *WebMessageInfo_STUBTYPE `protobuf:"varint,24,opt,name=messageStubType,enum=proto.WebMessageInfo_STUBTYPE" json:"messageStubType,omitempty"` - ClearMedia *bool `protobuf:"varint,25,opt,name=clearMedia" json:"clearMedia,omitempty"` - MessageStubParameters []string `protobuf:"bytes,26,rep,name=messageStubParameters" json:"messageStubParameters,omitempty"` - Duration *uint32 `protobuf:"varint,27,opt,name=duration" json:"duration,omitempty"` - Labels []string `protobuf:"bytes,28,rep,name=labels" json:"labels,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WebMessageInfo) Reset() { *m = WebMessageInfo{} } -func (m *WebMessageInfo) String() string { return proto.CompactTextString(m) } -func (*WebMessageInfo) ProtoMessage() {} -func (*WebMessageInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{30} -} -func (m *WebMessageInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WebMessageInfo.Unmarshal(m, b) -} -func (m *WebMessageInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WebMessageInfo.Marshal(b, m, deterministic) -} -func (dst *WebMessageInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_WebMessageInfo.Merge(dst, src) -} -func (m *WebMessageInfo) XXX_Size() int { - return xxx_messageInfo_WebMessageInfo.Size(m) -} -func (m *WebMessageInfo) XXX_DiscardUnknown() { - xxx_messageInfo_WebMessageInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_WebMessageInfo proto.InternalMessageInfo - -const Default_WebMessageInfo_Status WebMessageInfo_STATUS = WebMessageInfo_PENDING - -func (m *WebMessageInfo) GetKey() *MessageKey { - if m != nil { - return m.Key - } - return nil -} - -func (m *WebMessageInfo) GetMessage() *Message { - if m != nil { - return m.Message - } - return nil -} - -func (m *WebMessageInfo) GetMessageTimestamp() uint64 { - if m != nil && m.MessageTimestamp != nil { - return *m.MessageTimestamp - } - return 0 -} - -func (m *WebMessageInfo) GetStatus() WebMessageInfo_STATUS { - if m != nil && m.Status != nil { - return *m.Status - } - return Default_WebMessageInfo_Status -} - -func (m *WebMessageInfo) GetParticipant() string { - if m != nil && m.Participant != nil { - return *m.Participant - } - return "" -} - -func (m *WebMessageInfo) GetIgnore() bool { - if m != nil && m.Ignore != nil { - return *m.Ignore - } - return false -} - -func (m *WebMessageInfo) GetStarred() bool { - if m != nil && m.Starred != nil { - return *m.Starred - } - return false -} - -func (m *WebMessageInfo) GetBroadcast() bool { - if m != nil && m.Broadcast != nil { - return *m.Broadcast - } - return false -} - -func (m *WebMessageInfo) GetPushName() string { - if m != nil && m.PushName != nil { - return *m.PushName - } - return "" -} - -func (m *WebMessageInfo) GetMediaCiphertextSha256() []byte { - if m != nil { - return m.MediaCiphertextSha256 - } - return nil -} - -func (m *WebMessageInfo) GetMulticast() bool { - if m != nil && m.Multicast != nil { - return *m.Multicast - } - return false -} - -func (m *WebMessageInfo) GetUrlText() bool { - if m != nil && m.UrlText != nil { - return *m.UrlText - } - return false -} - -func (m *WebMessageInfo) GetUrlNumber() bool { - if m != nil && m.UrlNumber != nil { - return *m.UrlNumber - } - return false -} - -func (m *WebMessageInfo) GetMessageStubType() WebMessageInfo_STUBTYPE { - if m != nil && m.MessageStubType != nil { - return *m.MessageStubType - } - return WebMessageInfo_UNKNOWN -} - -func (m *WebMessageInfo) GetClearMedia() bool { - if m != nil && m.ClearMedia != nil { - return *m.ClearMedia - } - return false -} - -func (m *WebMessageInfo) GetMessageStubParameters() []string { - if m != nil { - return m.MessageStubParameters - } - return nil -} - -func (m *WebMessageInfo) GetDuration() uint32 { - if m != nil && m.Duration != nil { - return *m.Duration - } - return 0 -} - -func (m *WebMessageInfo) GetLabels() []string { - if m != nil { - return m.Labels - } - return nil -} - -type WebNotificationsInfo struct { - Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - UnreadChats *uint32 `protobuf:"varint,3,opt,name=unreadChats" json:"unreadChats,omitempty"` - NotifyMessageCount *uint32 `protobuf:"varint,4,opt,name=notifyMessageCount" json:"notifyMessageCount,omitempty"` - NotifyMessages []*Message `protobuf:"bytes,5,rep,name=notifyMessages" json:"notifyMessages,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WebNotificationsInfo) Reset() { *m = WebNotificationsInfo{} } -func (m *WebNotificationsInfo) String() string { return proto.CompactTextString(m) } -func (*WebNotificationsInfo) ProtoMessage() {} -func (*WebNotificationsInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{31} -} -func (m *WebNotificationsInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WebNotificationsInfo.Unmarshal(m, b) -} -func (m *WebNotificationsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WebNotificationsInfo.Marshal(b, m, deterministic) -} -func (dst *WebNotificationsInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_WebNotificationsInfo.Merge(dst, src) -} -func (m *WebNotificationsInfo) XXX_Size() int { - return xxx_messageInfo_WebNotificationsInfo.Size(m) -} -func (m *WebNotificationsInfo) XXX_DiscardUnknown() { - xxx_messageInfo_WebNotificationsInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_WebNotificationsInfo proto.InternalMessageInfo - -func (m *WebNotificationsInfo) GetTimestamp() uint64 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *WebNotificationsInfo) GetUnreadChats() uint32 { - if m != nil && m.UnreadChats != nil { - return *m.UnreadChats - } - return 0 -} - -func (m *WebNotificationsInfo) GetNotifyMessageCount() uint32 { - if m != nil && m.NotifyMessageCount != nil { - return *m.NotifyMessageCount - } - return 0 -} - -func (m *WebNotificationsInfo) GetNotifyMessages() []*Message { - if m != nil { - return m.NotifyMessages - } - return nil -} - -type NotificationMessageInfo struct { - Key *MessageKey `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - Message *Message `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - MessageTimestamp *uint64 `protobuf:"varint,3,opt,name=messageTimestamp" json:"messageTimestamp,omitempty"` - Participant *string `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NotificationMessageInfo) Reset() { *m = NotificationMessageInfo{} } -func (m *NotificationMessageInfo) String() string { return proto.CompactTextString(m) } -func (*NotificationMessageInfo) ProtoMessage() {} -func (*NotificationMessageInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{32} -} -func (m *NotificationMessageInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NotificationMessageInfo.Unmarshal(m, b) -} -func (m *NotificationMessageInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NotificationMessageInfo.Marshal(b, m, deterministic) -} -func (dst *NotificationMessageInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_NotificationMessageInfo.Merge(dst, src) -} -func (m *NotificationMessageInfo) XXX_Size() int { - return xxx_messageInfo_NotificationMessageInfo.Size(m) -} -func (m *NotificationMessageInfo) XXX_DiscardUnknown() { - xxx_messageInfo_NotificationMessageInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_NotificationMessageInfo proto.InternalMessageInfo - -func (m *NotificationMessageInfo) GetKey() *MessageKey { - if m != nil { - return m.Key - } - return nil -} - -func (m *NotificationMessageInfo) GetMessage() *Message { - if m != nil { - return m.Message - } - return nil -} - -func (m *NotificationMessageInfo) GetMessageTimestamp() uint64 { - if m != nil && m.MessageTimestamp != nil { - return *m.MessageTimestamp - } - return 0 -} - -func (m *NotificationMessageInfo) GetParticipant() string { - if m != nil && m.Participant != nil { - return *m.Participant - } - return "" -} - -type TabletNotificationsInfo struct { - Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - UnreadChats *uint32 `protobuf:"varint,3,opt,name=unreadChats" json:"unreadChats,omitempty"` - NotifyMessageCount *uint32 `protobuf:"varint,4,opt,name=notifyMessageCount" json:"notifyMessageCount,omitempty"` - NotifyMessage []*Message `protobuf:"bytes,5,rep,name=notifyMessage" json:"notifyMessage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TabletNotificationsInfo) Reset() { *m = TabletNotificationsInfo{} } -func (m *TabletNotificationsInfo) String() string { return proto.CompactTextString(m) } -func (*TabletNotificationsInfo) ProtoMessage() {} -func (*TabletNotificationsInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{33} -} -func (m *TabletNotificationsInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TabletNotificationsInfo.Unmarshal(m, b) -} -func (m *TabletNotificationsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TabletNotificationsInfo.Marshal(b, m, deterministic) -} -func (dst *TabletNotificationsInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TabletNotificationsInfo.Merge(dst, src) -} -func (m *TabletNotificationsInfo) XXX_Size() int { - return xxx_messageInfo_TabletNotificationsInfo.Size(m) -} -func (m *TabletNotificationsInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TabletNotificationsInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_TabletNotificationsInfo proto.InternalMessageInfo - -func (m *TabletNotificationsInfo) GetTimestamp() uint64 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *TabletNotificationsInfo) GetUnreadChats() uint32 { - if m != nil && m.UnreadChats != nil { - return *m.UnreadChats - } - return 0 -} - -func (m *TabletNotificationsInfo) GetNotifyMessageCount() uint32 { - if m != nil && m.NotifyMessageCount != nil { - return *m.NotifyMessageCount - } - return 0 -} - -func (m *TabletNotificationsInfo) GetNotifyMessage() []*Message { - if m != nil { - return m.NotifyMessage - } - return nil -} - -type WebFeatures struct { - LabelsDisplay *WebFeatures_FLAG `protobuf:"varint,1,opt,name=labelsDisplay,enum=proto.WebFeatures_FLAG" json:"labelsDisplay,omitempty"` - VoipIndividualOutgoing *WebFeatures_FLAG `protobuf:"varint,2,opt,name=voipIndividualOutgoing,enum=proto.WebFeatures_FLAG" json:"voipIndividualOutgoing,omitempty"` - GroupsV3 *WebFeatures_FLAG `protobuf:"varint,3,opt,name=groupsV3,enum=proto.WebFeatures_FLAG" json:"groupsV3,omitempty"` - GroupsV3Create *WebFeatures_FLAG `protobuf:"varint,4,opt,name=groupsV3Create,enum=proto.WebFeatures_FLAG" json:"groupsV3Create,omitempty"` - ChangeNumberV2 *WebFeatures_FLAG `protobuf:"varint,5,opt,name=changeNumberV2,enum=proto.WebFeatures_FLAG" json:"changeNumberV2,omitempty"` - QueryStatusV3Thumbnail *WebFeatures_FLAG `protobuf:"varint,6,opt,name=queryStatusV3Thumbnail,enum=proto.WebFeatures_FLAG" json:"queryStatusV3Thumbnail,omitempty"` - LiveLocations *WebFeatures_FLAG `protobuf:"varint,7,opt,name=liveLocations,enum=proto.WebFeatures_FLAG" json:"liveLocations,omitempty"` - QueryVname *WebFeatures_FLAG `protobuf:"varint,8,opt,name=queryVname,enum=proto.WebFeatures_FLAG" json:"queryVname,omitempty"` - VoipIndividualIncoming *WebFeatures_FLAG `protobuf:"varint,9,opt,name=voipIndividualIncoming,enum=proto.WebFeatures_FLAG" json:"voipIndividualIncoming,omitempty"` - QuickRepliesQuery *WebFeatures_FLAG `protobuf:"varint,10,opt,name=quickRepliesQuery,enum=proto.WebFeatures_FLAG" json:"quickRepliesQuery,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WebFeatures) Reset() { *m = WebFeatures{} } -func (m *WebFeatures) String() string { return proto.CompactTextString(m) } -func (*WebFeatures) ProtoMessage() {} -func (*WebFeatures) Descriptor() ([]byte, []int) { - return fileDescriptor_def_131d1935231ace52, []int{34} -} -func (m *WebFeatures) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WebFeatures.Unmarshal(m, b) -} -func (m *WebFeatures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WebFeatures.Marshal(b, m, deterministic) -} -func (dst *WebFeatures) XXX_Merge(src proto.Message) { - xxx_messageInfo_WebFeatures.Merge(dst, src) -} -func (m *WebFeatures) XXX_Size() int { - return xxx_messageInfo_WebFeatures.Size(m) -} -func (m *WebFeatures) XXX_DiscardUnknown() { - xxx_messageInfo_WebFeatures.DiscardUnknown(m) -} - -var xxx_messageInfo_WebFeatures proto.InternalMessageInfo - -func (m *WebFeatures) GetLabelsDisplay() WebFeatures_FLAG { - if m != nil && m.LabelsDisplay != nil { - return *m.LabelsDisplay - } - return WebFeatures_NOT_IMPLEMENTED -} - -func (m *WebFeatures) GetVoipIndividualOutgoing() WebFeatures_FLAG { - if m != nil && m.VoipIndividualOutgoing != nil { - return *m.VoipIndividualOutgoing - } - return WebFeatures_NOT_IMPLEMENTED -} - -func (m *WebFeatures) GetGroupsV3() WebFeatures_FLAG { - if m != nil && m.GroupsV3 != nil { - return *m.GroupsV3 - } - return WebFeatures_NOT_IMPLEMENTED -} - -func (m *WebFeatures) GetGroupsV3Create() WebFeatures_FLAG { - if m != nil && m.GroupsV3Create != nil { - return *m.GroupsV3Create - } - return WebFeatures_NOT_IMPLEMENTED -} - -func (m *WebFeatures) GetChangeNumberV2() WebFeatures_FLAG { - if m != nil && m.ChangeNumberV2 != nil { - return *m.ChangeNumberV2 - } - return WebFeatures_NOT_IMPLEMENTED -} - -func (m *WebFeatures) GetQueryStatusV3Thumbnail() WebFeatures_FLAG { - if m != nil && m.QueryStatusV3Thumbnail != nil { - return *m.QueryStatusV3Thumbnail - } - return WebFeatures_NOT_IMPLEMENTED -} - -func (m *WebFeatures) GetLiveLocations() WebFeatures_FLAG { - if m != nil && m.LiveLocations != nil { - return *m.LiveLocations - } - return WebFeatures_NOT_IMPLEMENTED -} - -func (m *WebFeatures) GetQueryVname() WebFeatures_FLAG { - if m != nil && m.QueryVname != nil { - return *m.QueryVname - } - return WebFeatures_NOT_IMPLEMENTED -} - -func (m *WebFeatures) GetVoipIndividualIncoming() WebFeatures_FLAG { - if m != nil && m.VoipIndividualIncoming != nil { - return *m.VoipIndividualIncoming - } - return WebFeatures_NOT_IMPLEMENTED -} - -func (m *WebFeatures) GetQuickRepliesQuery() WebFeatures_FLAG { - if m != nil && m.QuickRepliesQuery != nil { - return *m.QuickRepliesQuery - } - return WebFeatures_NOT_IMPLEMENTED -} - -func init() { - proto.RegisterType((*FingerprintData)(nil), "proto.FingerprintData") - proto.RegisterType((*CombinedFingerprint)(nil), "proto.CombinedFingerprint") - proto.RegisterType((*MessageKey)(nil), "proto.MessageKey") - proto.RegisterType((*SenderKeyDistributionMessage)(nil), "proto.SenderKeyDistributionMessage") - proto.RegisterType((*ImageMessage)(nil), "proto.ImageMessage") - proto.RegisterType((*ContactMessage)(nil), "proto.ContactMessage") - proto.RegisterType((*LocationMessage)(nil), "proto.LocationMessage") - proto.RegisterType((*ExtendedTextMessage)(nil), "proto.ExtendedTextMessage") - proto.RegisterType((*DocumentMessage)(nil), "proto.DocumentMessage") - proto.RegisterType((*AudioMessage)(nil), "proto.AudioMessage") - proto.RegisterType((*VideoMessage)(nil), "proto.VideoMessage") - proto.RegisterType((*Call)(nil), "proto.Call") - proto.RegisterType((*Chat)(nil), "proto.Chat") - proto.RegisterType((*ProtocolMessage)(nil), "proto.ProtocolMessage") - proto.RegisterType((*ContactsArrayMessage)(nil), "proto.ContactsArrayMessage") - proto.RegisterType((*HSMCurrency)(nil), "proto.HSMCurrency") - proto.RegisterType((*HSMDateTimeComponent)(nil), "proto.HSMDateTimeComponent") - proto.RegisterType((*HSMDateTimeUnixEpoch)(nil), "proto.HSMDateTimeUnixEpoch") - proto.RegisterType((*HSMDateTime)(nil), "proto.HSMDateTime") - proto.RegisterType((*HSMLocalizableParameter)(nil), "proto.HSMLocalizableParameter") - proto.RegisterType((*HighlyStructuredMessage)(nil), "proto.HighlyStructuredMessage") - proto.RegisterType((*SendPaymentMessage)(nil), "proto.SendPaymentMessage") - proto.RegisterType((*RequestPaymentMessage)(nil), "proto.RequestPaymentMessage") - proto.RegisterType((*LiveLocationMessage)(nil), "proto.LiveLocationMessage") - proto.RegisterType((*StickerMessage)(nil), "proto.StickerMessage") - proto.RegisterType((*Message)(nil), "proto.Message") - proto.RegisterType((*ContextInfo)(nil), "proto.ContextInfo") - proto.RegisterType((*InteractiveAnnotation)(nil), "proto.InteractiveAnnotation") - proto.RegisterType((*Point)(nil), "proto.Point") - proto.RegisterType((*Location)(nil), "proto.Location") - proto.RegisterType((*WebMessageInfo)(nil), "proto.WebMessageInfo") - proto.RegisterType((*WebNotificationsInfo)(nil), "proto.WebNotificationsInfo") - proto.RegisterType((*NotificationMessageInfo)(nil), "proto.NotificationMessageInfo") - proto.RegisterType((*TabletNotificationsInfo)(nil), "proto.TabletNotificationsInfo") - proto.RegisterType((*WebFeatures)(nil), "proto.WebFeatures") - proto.RegisterEnum("proto.ExtendedTextMessage_FONTTYPE", ExtendedTextMessage_FONTTYPE_name, ExtendedTextMessage_FONTTYPE_value) - proto.RegisterEnum("proto.VideoMessage_ATTRIBUTION", VideoMessage_ATTRIBUTION_name, VideoMessage_ATTRIBUTION_value) - proto.RegisterEnum("proto.ProtocolMessage_TYPE", ProtocolMessage_TYPE_name, ProtocolMessage_TYPE_value) - proto.RegisterEnum("proto.HSMDateTimeComponent_DAYOFWEEKTYPE", HSMDateTimeComponent_DAYOFWEEKTYPE_name, HSMDateTimeComponent_DAYOFWEEKTYPE_value) - proto.RegisterEnum("proto.HSMDateTimeComponent_CALENDARTYPE", HSMDateTimeComponent_CALENDARTYPE_name, HSMDateTimeComponent_CALENDARTYPE_value) - proto.RegisterEnum("proto.WebMessageInfo_STATUS", WebMessageInfo_STATUS_name, WebMessageInfo_STATUS_value) - proto.RegisterEnum("proto.WebMessageInfo_STUBTYPE", WebMessageInfo_STUBTYPE_name, WebMessageInfo_STUBTYPE_value) - proto.RegisterEnum("proto.WebFeatures_FLAG", WebFeatures_FLAG_name, WebFeatures_FLAG_value) -} - -func init() { proto.RegisterFile("def.proto", fileDescriptor_def_131d1935231ace52) } - -var fileDescriptor_def_131d1935231ace52 = []byte{ - // 3724 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x3a, 0x4d, 0x6f, 0xe3, 0x48, - 0x76, 0xad, 0x0f, 0xdb, 0xd2, 0x93, 0x2c, 0xd1, 0x65, 0xbb, 0xad, 0xe9, 0xf6, 0xce, 0x78, 0xd9, - 0x9b, 0x59, 0xef, 0x04, 0xeb, 0xf4, 0x78, 0x3a, 0x33, 0xc1, 0x06, 0x83, 0x84, 0x96, 0x68, 0x9b, - 0xdd, 0x32, 0xa9, 0x2d, 0x51, 0xf6, 0xf8, 0x24, 0x94, 0xc9, 0xb2, 0xc4, 0x34, 0x45, 0x6a, 0xc8, - 0x92, 0xa7, 0xb5, 0x01, 0x72, 0xd9, 0x4b, 0x10, 0x20, 0xf7, 0x5c, 0x83, 0x20, 0xd7, 0x5c, 0x02, - 0x04, 0x9b, 0x00, 0x49, 0x7e, 0x42, 0xfe, 0x46, 0x0e, 0xb9, 0xe4, 0x96, 0x4b, 0x90, 0xa0, 0x8a, - 0xa4, 0x44, 0x4a, 0xb2, 0xbb, 0xa7, 0x93, 0xe9, 0xe4, 0x64, 0xd5, 0xfb, 0xaa, 0x57, 0xef, 0xd5, - 0x7b, 0xf5, 0xde, 0xa3, 0xa1, 0x6c, 0xd3, 0xdb, 0xa3, 0x71, 0xe0, 0x33, 0x1f, 0xad, 0x89, 0x3f, - 0xb2, 0x01, 0xf5, 0x53, 0xc7, 0x1b, 0xd0, 0x60, 0x1c, 0x38, 0x1e, 0x6b, 0x11, 0x46, 0xd0, 0x3e, - 0x94, 0xc7, 0x93, 0x1b, 0xd7, 0xb1, 0x5e, 0xd1, 0x69, 0x23, 0x77, 0x90, 0x3b, 0x2c, 0xe3, 0x39, - 0x00, 0x7d, 0x0c, 0xe0, 0xd8, 0xd4, 0x63, 0xce, 0xad, 0x43, 0x83, 0x46, 0x5e, 0xa0, 0x53, 0x10, - 0xf9, 0xef, 0x73, 0xb0, 0xdd, 0xf4, 0x47, 0x37, 0x8e, 0x47, 0xed, 0x94, 0x64, 0xd4, 0x80, 0x8d, - 0x3b, 0x1a, 0x84, 0x8e, 0xef, 0x09, 0x99, 0x9b, 0x38, 0x59, 0xa2, 0x13, 0x90, 0x5c, 0xdf, 0x22, - 0x6e, 0x8a, 0x5a, 0xc8, 0xad, 0x1c, 0x3f, 0x8e, 0x74, 0x3d, 0x5a, 0xd0, 0x10, 0x2f, 0xd1, 0xa3, - 0x16, 0x6c, 0x05, 0x74, 0xe4, 0x33, 0x9a, 0x16, 0x52, 0x78, 0x50, 0xc8, 0x32, 0x83, 0xcc, 0x00, - 0x2e, 0x68, 0x18, 0x92, 0x01, 0xe5, 0x27, 0xdd, 0x87, 0x72, 0x44, 0xf2, 0xd2, 0xb1, 0x13, 0x3b, - 0xcc, 0x00, 0xe8, 0x31, 0xac, 0xdf, 0x06, 0xfe, 0xe8, 0x82, 0x0a, 0x5d, 0x4b, 0x38, 0x5e, 0xa1, - 0x1a, 0xe4, 0x1d, 0x5b, 0x6c, 0x5d, 0xc6, 0x79, 0xc7, 0x46, 0x07, 0x50, 0x19, 0x93, 0x80, 0x39, - 0x96, 0x33, 0x26, 0x1e, 0x6b, 0x14, 0x05, 0x22, 0x0d, 0x92, 0xff, 0x2c, 0x07, 0xfb, 0x5d, 0xea, - 0xd9, 0x34, 0x78, 0x45, 0xa7, 0x2d, 0x27, 0x64, 0x81, 0x73, 0x33, 0x61, 0x8e, 0xef, 0xc5, 0xba, - 0x70, 0xd3, 0x0d, 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0x4b, 0x9d, 0x3f, 0xc2, 0x73, 0x7a, - 0xce, 0x3c, 0x49, 0xf6, 0x8d, 0xe7, 0x1f, 0x2b, 0x98, 0x67, 0xaa, 0x71, 0xe6, 0x19, 0xfd, 0x49, - 0x1d, 0x36, 0x6d, 0xc2, 0x28, 0x57, 0xcd, 0xf0, 0xa8, 0x7f, 0x2b, 0xff, 0x75, 0x0e, 0xf6, 0xce, - 0xbb, 0x17, 0xbc, 0x33, 0x72, 0x9d, 0x5f, 0x91, 0x1b, 0x97, 0x76, 0x48, 0x40, 0x46, 0x94, 0xd1, - 0x80, 0xe7, 0x1b, 0x9b, 0xde, 0x92, 0x89, 0x9b, 0xf4, 0x05, 0xc9, 0x12, 0x3d, 0x87, 0x52, 0x72, - 0xe3, 0x63, 0x15, 0xd0, 0x5c, 0x85, 0x24, 0x56, 0xce, 0x1f, 0xe1, 0x19, 0x15, 0xe7, 0xb0, 0x63, - 0xd5, 0xe2, 0x79, 0x0b, 0x5a, 0x56, 0x9a, 0x73, 0x24, 0x54, 0x27, 0x55, 0x80, 0x31, 0x57, 0x25, - 0xd2, 0xf3, 0xbf, 0xb8, 0x9e, 0xce, 0x60, 0xe8, 0x4e, 0xbb, 0x2c, 0x98, 0x58, 0x6c, 0x12, 0x50, - 0x3b, 0xc9, 0x16, 0xfb, 0x50, 0xe6, 0x4d, 0x56, 0x38, 0x26, 0x56, 0x12, 0x90, 0x73, 0x00, 0xcf, - 0x25, 0xd4, 0xa5, 0xbc, 0xea, 0x15, 0xb9, 0x24, 0x6e, 0x63, 0x52, 0x20, 0x7e, 0x9f, 0xc5, 0x4e, - 0x61, 0xa3, 0x70, 0x50, 0x38, 0x2c, 0xe3, 0x78, 0x25, 0xde, 0x74, 0xe2, 0xba, 0xfc, 0x35, 0x6d, - 0x0f, 0xe2, 0xe6, 0x26, 0x05, 0xc9, 0xe0, 0xad, 0xb8, 0xb3, 0x49, 0x41, 0x50, 0x1b, 0xb6, 0xdc, - 0x05, 0xbb, 0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 0xd3, 0xb0, 0x91, 0x13, - 0xd6, 0xac, 0x26, 0x89, 0xc3, 0x77, 0x3c, 0x86, 0x17, 0x89, 0xd0, 0xcf, 0xa1, 0x94, 0xe4, 0xf1, - 0xf8, 0x0d, 0xab, 0x2f, 0xe4, 0x7b, 0xde, 0x5f, 0x24, 0x24, 0x27, 0x25, 0x58, 0xe7, 0x5b, 0xfb, - 0x9e, 0xfc, 0x0c, 0xd6, 0x84, 0x48, 0x54, 0x85, 0xdc, 0x1b, 0xf1, 0x4a, 0xe5, 0x70, 0xee, 0x0d, - 0x5f, 0x45, 0x05, 0x45, 0x0e, 0xe7, 0xa6, 0x32, 0x83, 0x52, 0x22, 0xe6, 0xc3, 0x7d, 0x37, 0x92, - 0xff, 0xa5, 0x0e, 0xb5, 0x2b, 0x7a, 0x13, 0x5f, 0x18, 0x71, 0x51, 0x67, 0xe3, 0x99, 0xfc, 0x03, - 0xe3, 0x99, 0x43, 0xd8, 0x18, 0x3d, 0xd8, 0x12, 0x24, 0x68, 0xae, 0x61, 0xfc, 0xd3, 0x9c, 0x35, - 0xb0, 0x05, 0x51, 0xbd, 0x2c, 0xc1, 0xd1, 0xd7, 0xb0, 0x1e, 0x32, 0xc2, 0x26, 0x51, 0x71, 0x5b, - 0x9b, 0x65, 0x81, 0xac, 0x86, 0x47, 0x5d, 0x53, 0x31, 0x7b, 0xdd, 0x5f, 0x6c, 0x74, 0x54, 0xbd, - 0xa5, 0xe9, 0x67, 0x38, 0x66, 0x5a, 0x0c, 0xa3, 0xb5, 0xe5, 0x30, 0x7a, 0x0c, 0xeb, 0xce, 0xc0, - 0xf3, 0x83, 0x28, 0x69, 0x95, 0x70, 0xbc, 0x12, 0xd3, 0x53, 0x46, 0x82, 0x80, 0xda, 0x22, 0xff, - 0x94, 0x70, 0xb2, 0xe4, 0x21, 0x74, 0x13, 0xf8, 0xc4, 0xb6, 0x48, 0xc8, 0xc4, 0xcd, 0x2f, 0xe1, - 0x39, 0x80, 0x07, 0xf5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x4c, 0xbd, 0xfc, 0x62, 0x3e, 0xa4, 0x5b, 0x7f, 0x8b, 0x1d, 0x56, 0xb3, 0x09, 0xbf, 0xa4, 0x3a, - 0xd6, 0x30, 0xfe, 0x1a, 0xf6, 0x80, 0x5f, 0xd2, 0xd4, 0xe8, 0x2b, 0x00, 0x21, 0xf8, 0xd2, 0x4b, - 0xfe, 0xb3, 0xe5, 0x01, 0xde, 0x14, 0xe9, 0xb2, 0x43, 0x35, 0xcf, 0xf2, 0x47, 0xdc, 0xa1, 0xe5, - 0xef, 0xe5, 0xd0, 0x84, 0x0d, 0xa9, 0xb0, 0xf5, 0xed, 0xc4, 0xb1, 0x5e, 0x63, 0x3a, 0x76, 0x1d, - 0x1a, 0xfe, 0x92, 0x6f, 0x25, 0x46, 0x42, 0x0f, 0xc8, 0x5a, 0xe6, 0x90, 0x7f, 0x01, 0x45, 0x8e, - 0x8a, 0xfe, 0xa7, 0xc9, 0xec, 0x6b, 0x17, 0x9d, 0xb6, 0x7a, 0xa1, 0xea, 0x3c, 0xdd, 0x3e, 0xe2, - 0x75, 0x59, 0x1a, 0x90, 0x43, 0x55, 0x28, 0x19, 0xe2, 0x75, 0x54, 0xda, 0x52, 0xfe, 0xbf, 0x03, - 0x00, 0x00, 0xff, 0xff, 0x11, 0x17, 0x9b, 0xf6, 0x8b, 0x2c, 0x00, 0x00, -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/binary/proto/def.proto b/vendor/github.com/matterbridge/go-whatsapp/binary/proto/def.proto deleted file mode 100644 index a885973d..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/binary/proto/def.proto +++ /dev/null @@ -1,417 +0,0 @@ -syntax = "proto2"; -package proto; - -message FingerprintData { - optional string publicKey = 1; - optional string identifier = 2; -} - -message CombinedFingerprint { - optional uint32 version = 1; - optional FingerprintData localFingerprint = 2; - optional FingerprintData remoteFingerprint = 3; -} - -message MessageKey { - optional string remoteJid = 1; - optional bool fromMe = 2; - optional string id = 3; - optional string participant = 4; -} - -message SenderKeyDistributionMessage { - optional string groupId = 1; - optional bytes axolotlSenderKeyDistributionMessage = 2; -} - -message ImageMessage { - optional string url = 1; - optional string mimetype = 2; - optional string caption = 3; - optional bytes fileSha256 = 4; - optional uint64 fileLength = 5; - optional uint32 height = 6; - optional uint32 width = 7; - optional bytes mediaKey = 8; - optional bytes fileEncSha256 = 9; - repeated InteractiveAnnotation interactiveAnnotations = 10; - optional string directPath = 11; - optional bytes jpegThumbnail = 16; - optional ContextInfo contextInfo = 17; - optional bytes firstScanSidecar = 18; - optional uint32 firstScanLength = 19; -} - -message ContactMessage { - optional string displayName = 1; - optional string vcard = 16; - optional ContextInfo contextInfo = 17; -} - -message LocationMessage { - optional double degreesLatitude = 1; - optional double degreesLongitude = 2; - optional string name = 3; - optional string address = 4; - optional string url = 5; - optional bytes jpegThumbnail = 16; - optional ContextInfo contextInfo = 17; -} - -message ExtendedTextMessage { - optional string text = 1; - optional string matchedText = 2; - optional string canonicalUrl = 4; - optional string description = 5; - optional string title = 6; - optional fixed32 textArgb = 7; - optional fixed32 backgroundArgb = 8; - enum FONTTYPE { - SANS_SERIF = 0; - SERIF = 1; - NORICAN_REGULAR = 2; - BRYNDAN_WRITE = 3; - BEBASNEUE_REGULAR = 4; - OSWALD_HEAVY = 5; - } - optional FONTTYPE font = 9; - optional bytes jpegThumbnail = 16; - optional ContextInfo contextInfo = 17; -} - -message DocumentMessage { - optional string url = 1; - optional string mimetype = 2; - optional string title = 3; - optional bytes fileSha256 = 4; - optional uint64 fileLength = 5; - optional uint32 pageCount = 6; - optional bytes mediaKey = 7; - optional string fileName = 8; - optional bytes fileEncSha256 = 9; - optional string directPath = 10; - optional bytes jpegThumbnail = 16; - optional ContextInfo contextInfo = 17; -} - -message AudioMessage { - optional string url = 1; - optional string mimetype = 2; - optional bytes fileSha256 = 3; - optional uint64 fileLength = 4; - optional uint32 seconds = 5; - optional bool ptt = 6; - optional bytes mediaKey = 7; - optional bytes fileEncSha256 = 8; - optional string directPath = 9; - optional ContextInfo contextInfo = 17; - optional bytes streamingSidecar = 18; -} - -message VideoMessage { - optional string url = 1; - optional string mimetype = 2; - optional bytes fileSha256 = 3; - optional uint64 fileLength = 4; - optional uint32 seconds = 5; - optional bytes mediaKey = 6; - optional string caption = 7; - optional bool gifPlayback = 8; - optional uint32 height = 9; - optional uint32 width = 10; - optional bytes fileEncSha256 = 11; - repeated InteractiveAnnotation interactiveAnnotations = 12; - optional string directPath = 13; - optional bytes jpegThumbnail = 16; - optional ContextInfo contextInfo = 17; - optional bytes streamingSidecar = 18; - enum ATTRIBUTION { - NONE = 0; - GIPHY = 1; - TENOR = 2; - } - optional ATTRIBUTION gifAttribution = 19; -} - -message Call { - optional bytes callKey = 1; -} - -message Chat { - optional string displayName = 1; - optional string id = 2; -} - -message ProtocolMessage { - optional MessageKey key = 1; - enum TYPE { - REVOKE = 0; - } - optional TYPE type = 2; -} - -message ContactsArrayMessage { - optional string displayName = 1; - repeated ContactMessage contacts = 2; - optional ContextInfo contextInfo = 17; -} - -message HSMCurrency { - optional string currencyCode = 1; - optional int64 amount1000 = 2; -} - -message HSMDateTimeComponent { - enum DAYOFWEEKTYPE { - MONDAY = 1; - TUESDAY = 2; - WEDNESDAY = 3; - THURSDAY = 4; - FRIDAY = 5; - SATURDAY = 6; - SUNDAY = 7; - } - optional DAYOFWEEKTYPE dayOfWeek = 1; - optional uint32 year = 2; - optional uint32 month = 3; - optional uint32 dayOfMonth = 4; - optional uint32 hour = 5; - optional uint32 minute = 6; - enum CALENDARTYPE { - GREGORIAN = 1; - SOLAR_HIJRI = 2; - } - optional CALENDARTYPE calendar = 7; -} - -message HSMDateTimeUnixEpoch { - optional int64 timestamp = 1; -} - -message HSMDateTime { - oneof datetimeOneof { - HSMDateTimeComponent component = 1; - HSMDateTimeUnixEpoch unixEpoch = 2; - } -} - -message HSMLocalizableParameter { - optional string default = 1; - oneof paramOneof { - HSMCurrency currency = 2; - HSMDateTime dateTime = 3; - } -} - -message HighlyStructuredMessage { - optional string namespace = 1; - optional string elementName = 2; - repeated string params = 3; - optional string fallbackLg = 4; - optional string fallbackLc = 5; - repeated HSMLocalizableParameter localizableParams = 6; -} - -message SendPaymentMessage { - optional Message noteMessage = 2; -} - -message RequestPaymentMessage { - optional string currencyCodeIso4217 = 1; - optional uint64 amount1000 = 2; - optional string requestFrom = 3; - optional Message noteMessage = 4; -} - -message LiveLocationMessage { - optional double degreesLatitude = 1; - optional double degreesLongitude = 2; - optional uint32 accuracyInMeters = 3; - optional float speedInMps = 4; - optional uint32 degreesClockwiseFromMagneticNorth = 5; - optional string caption = 6; - optional int64 sequenceNumber = 7; - optional bytes jpegThumbnail = 16; - optional ContextInfo contextInfo = 17; -} - -message StickerMessage { - optional string url = 1; - optional bytes fileSha256 = 2; - optional bytes fileEncSha256 = 3; - optional bytes mediaKey = 4; - optional string mimetype = 5; - optional uint32 height = 6; - optional uint32 width = 7; - optional string directPath = 8; - optional uint64 fileLength = 9; - optional bytes pngThumbnail = 16; - optional ContextInfo contextInfo = 17; -} - -message Message { - optional string conversation = 1; - optional SenderKeyDistributionMessage senderKeyDistributionMessage = 2; - optional ImageMessage imageMessage = 3; - optional ContactMessage contactMessage = 4; - optional LocationMessage locationMessage = 5; - optional ExtendedTextMessage extendedTextMessage = 6; - optional DocumentMessage documentMessage = 7; - optional AudioMessage audioMessage = 8; - optional VideoMessage videoMessage = 9; - optional Call call = 10; - optional Chat chat = 11; - optional ProtocolMessage protocolMessage = 12; - optional ContactsArrayMessage contactsArrayMessage = 13; - optional HighlyStructuredMessage highlyStructuredMessage = 14; - optional SenderKeyDistributionMessage fastRatchetKeySenderKeyDistributionMessage = 15; - optional SendPaymentMessage sendPaymentMessage = 16; - optional RequestPaymentMessage requestPaymentMessage = 17; - optional LiveLocationMessage liveLocationMessage = 18; - optional StickerMessage stickerMessage = 20; -} - -message ContextInfo { - optional string stanzaId = 1; - optional string participant = 2; - repeated Message quotedMessage = 3; - optional string remoteJid = 4; - repeated string mentionedJid = 15; - optional string conversionSource = 18; - optional bytes conversionData = 19; - optional uint32 conversionDelaySeconds = 20; - optional bool isForwarded = 22; - reserved 16, 17; -} - -message InteractiveAnnotation { - repeated Point polygonVertices = 1; - oneof action { - Location location = 2; - } -} - -message Point { - optional double x = 3; - optional double y = 4; -} - -message Location { - optional double degreesLatitude = 1; - optional double degreesLongitude = 2; - optional string name = 3; -} - -message WebMessageInfo { - required MessageKey key = 1; - optional Message message = 2; - optional uint64 messageTimestamp = 3; - enum STATUS { - ERROR = 0; - PENDING = 1; - SERVER_ACK = 2; - DELIVERY_ACK = 3; - READ = 4; - PLAYED = 5; - } - optional STATUS status = 4 [default=PENDING]; - optional string participant = 5; - optional bool ignore = 16; - optional bool starred = 17; - optional bool broadcast = 18; - optional string pushName = 19; - optional bytes mediaCiphertextSha256 = 20; - optional bool multicast = 21; - optional bool urlText = 22; - optional bool urlNumber = 23; - enum STUBTYPE { - UNKNOWN = 0; - REVOKE = 1; - CIPHERTEXT = 2; - FUTUREPROOF = 3; - NON_VERIFIED_TRANSITION = 4; - UNVERIFIED_TRANSITION = 5; - VERIFIED_TRANSITION = 6; - VERIFIED_LOW_UNKNOWN = 7; - VERIFIED_HIGH = 8; - VERIFIED_INITIAL_UNKNOWN = 9; - VERIFIED_INITIAL_LOW = 10; - VERIFIED_INITIAL_HIGH = 11; - VERIFIED_TRANSITION_ANY_TO_NONE = 12; - VERIFIED_TRANSITION_ANY_TO_HIGH = 13; - VERIFIED_TRANSITION_HIGH_TO_LOW = 14; - VERIFIED_TRANSITION_HIGH_TO_UNKNOWN = 15; - VERIFIED_TRANSITION_UNKNOWN_TO_LOW = 16; - VERIFIED_TRANSITION_LOW_TO_UNKNOWN = 17; - VERIFIED_TRANSITION_NONE_TO_LOW = 18; - VERIFIED_TRANSITION_NONE_TO_UNKNOWN = 19; - GROUP_CREATE = 20; - GROUP_CHANGE_SUBJECT = 21; - GROUP_CHANGE_ICON = 22; - GROUP_CHANGE_INVITE_LINK = 23; - GROUP_CHANGE_DESCRIPTION = 24; - GROUP_CHANGE_RESTRICT = 25; - GROUP_CHANGE_ANNOUNCE = 26; - GROUP_PARTICIPANT_ADD = 27; - GROUP_PARTICIPANT_REMOVE = 28; - GROUP_PARTICIPANT_PROMOTE = 29; - GROUP_PARTICIPANT_DEMOTE = 30; - GROUP_PARTICIPANT_INVITE = 31; - GROUP_PARTICIPANT_LEAVE = 32; - GROUP_PARTICIPANT_CHANGE_NUMBER = 33; - BROADCAST_CREATE = 34; - BROADCAST_ADD = 35; - BROADCAST_REMOVE = 36; - GENERIC_NOTIFICATION = 37; - E2E_IDENTITY_CHANGED = 38; - E2E_ENCRYPTED = 39; - CALL_MISSED_VOICE = 40; - CALL_MISSED_VIDEO = 41; - INDIVIDUAL_CHANGE_NUMBER = 42; - GROUP_DELETE = 43; - } - optional STUBTYPE messageStubType = 24; - optional bool clearMedia = 25; - repeated string messageStubParameters = 26; - optional uint32 duration = 27; - repeated string labels = 28; -} - -message WebNotificationsInfo { - optional uint64 timestamp = 2; - optional uint32 unreadChats = 3; - optional uint32 notifyMessageCount = 4; - repeated Message notifyMessages = 5; -} - -message NotificationMessageInfo { - optional MessageKey key = 1; - optional Message message = 2; - optional uint64 messageTimestamp = 3; - optional string participant = 4; -} - -message TabletNotificationsInfo { - optional uint64 timestamp = 2; - optional uint32 unreadChats = 3; - optional uint32 notifyMessageCount = 4; - repeated Message notifyMessage = 5; -} - -message WebFeatures { - enum FLAG { - NOT_IMPLEMENTED = 0; - IMPLEMENTED = 1; - OPTIONAL = 2; - } - optional FLAG labelsDisplay = 1; - optional FLAG voipIndividualOutgoing = 2; - optional FLAG groupsV3 = 3; - optional FLAG groupsV3Create = 4; - optional FLAG changeNumberV2 = 5; - optional FLAG queryStatusV3Thumbnail = 6; - optional FLAG liveLocations = 7; - optional FLAG queryVname = 8; - optional FLAG voipIndividualIncoming = 9; - optional FLAG quickRepliesQuery = 10; -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/binary/token/token.go b/vendor/github.com/matterbridge/go-whatsapp/binary/token/token.go deleted file mode 100644 index 070a6896..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/binary/token/token.go +++ /dev/null @@ -1,78 +0,0 @@ -package token - -import "fmt" - -var SingleByteTokens = [...]string{"", "", "", "200", "400", "404", "500", "501", "502", "action", "add", - "after", "archive", "author", "available", "battery", "before", "body", - "broadcast", "chat", "clear", "code", "composing", "contacts", "count", - "create", "debug", "delete", "demote", "duplicate", "encoding", "error", - "false", "filehash", "from", "g.us", "group", "groups_v2", "height", "id", - "image", "in", "index", "invis", "item", "jid", "kind", "last", "leave", - "live", "log", "media", "message", "mimetype", "missing", "modify", "name", - "notification", "notify", "out", "owner", "participant", "paused", - "picture", "played", "presence", "preview", "promote", "query", "raw", - "read", "receipt", "received", "recipient", "recording", "relay", - "remove", "response", "resume", "retry", "s.whatsapp.net", "seconds", - "set", "size", "status", "subject", "subscribe", "t", "text", "to", "true", - "type", "unarchive", "unavailable", "url", "user", "value", "web", "width", - "mute", "read_only", "admin", "creator", "short", "update", "powersave", - "checksum", "epoch", "block", "previous", "409", "replaced", "reason", - "spam", "modify_tag", "message_info", "delivery", "emoji", "title", - "description", "canonical-url", "matched-text", "star", "unstar", - "media_key", "filename", "identity", "unread", "page", "page_count", - "search", "media_message", "security", "call_log", "profile", "ciphertext", - "invite", "gif", "vcard", "frequent", "privacy", "blacklist", "whitelist", - "verify", "location", "document", "elapsed", "revoke_invite", "expiration", - "unsubscribe", "disable", "vname", "old_jid", "new_jid", "announcement", - "locked", "prop", "label", "color", "call", "offer", "call-id"} - -var doubleByteTokens = [...]string{} - -func GetSingleToken(i int) (string, error) { - if i < 3 || i >= len(SingleByteTokens) { - return "", fmt.Errorf("index out of single byte token bounds %d", i) - } - - return SingleByteTokens[i], nil -} - -func GetDoubleToken(index1 int, index2 int) (string, error) { - n := 256*index1 + index2 - if n < 0 || n >= len(doubleByteTokens) { - return "", fmt.Errorf("index out of double byte token bounds %d", n) - } - - return doubleByteTokens[n], nil -} - -func IndexOfSingleToken(token string) int { - for i, t := range SingleByteTokens { - if t == token { - return i - } - } - - return -1 -} - -const ( - LIST_EMPTY = 0 - STREAM_END = 2 - DICTIONARY_0 = 236 - DICTIONARY_1 = 237 - DICTIONARY_2 = 238 - DICTIONARY_3 = 239 - LIST_8 = 248 - LIST_16 = 249 - JID_PAIR = 250 - HEX_8 = 251 - BINARY_8 = 252 - BINARY_20 = 253 - BINARY_32 = 254 - NIBBLE_8 = 255 -) - -const ( - PACKED_MAX = 254 - SINGLE_BYTE_MAX = 256 -) diff --git a/vendor/github.com/matterbridge/go-whatsapp/conn.go b/vendor/github.com/matterbridge/go-whatsapp/conn.go deleted file mode 100644 index caae5dbb..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/conn.go +++ /dev/null @@ -1,389 +0,0 @@ -//Package whatsapp provides a developer API to interact with the WhatsAppWeb-Servers. -package whatsapp - -import ( - "crypto/hmac" - "crypto/sha256" - "encoding/json" - "fmt" - "math/rand" - "net/http" - "os" - "strconv" - "strings" - "sync" - "time" - - "github.com/gorilla/websocket" - "github.com/matterbridge/go-whatsapp/binary" - "github.com/matterbridge/go-whatsapp/crypto/cbc" -) - -type metric byte - -const ( - debugLog metric = iota + 1 - queryResume - queryReceipt - queryMedia - queryChat - queryContacts - queryMessages - presence - presenceSubscribe - group - read - chat - received - pic - status - message - queryActions - block - queryGroup - queryPreview - queryEmoji - queryMessageInfo - spam - querySearch - queryIdentity - queryUrl - profile - contact - queryVcard - queryStatus - queryStatusUpdate - privacyStatus - queryLiveLocations - liveLocation - queryVname - queryLabels - call - queryCall - queryQuickReplies -) - -type flag byte - -const ( - ignore flag = 1 << (7 - iota) - ackRequest - available - notAvailable - expires - skipOffline -) - -/* -Conn is created by NewConn. Interacting with the initialized Conn is the main way of interacting with our package. -It holds all necessary information to make the package work internally. -*/ -type Conn struct { - wsConn *websocket.Conn - wsConnOK bool - wsConnMutex sync.RWMutex - session *Session - listener map[string]chan string - listenerMutex sync.RWMutex - writeChan chan wsMsg - handler []Handler - msgCount int - msgTimeout time.Duration - Info *Info - Store *Store - ServerLastSeen time.Time - - longClientName string - shortClientName string -} - -type wsMsg struct { - messageType int - data []byte -} - -/* -Creates a new connection with a given timeout. The websocket connection to the WhatsAppWeb servers get´s established. -The goroutine for handling incoming messages is started -*/ -func NewConn(timeout time.Duration) (*Conn, error) { - wac := &Conn{ - wsConn: nil, // will be set in connect() - wsConnMutex: sync.RWMutex{}, - listener: make(map[string]chan string), - listenerMutex: sync.RWMutex{}, - writeChan: make(chan wsMsg), - handler: make([]Handler, 0), - msgCount: 0, - msgTimeout: timeout, - Store: newStore(), - - longClientName: "github.com/rhymen/go-whatsapp", - shortClientName: "go-whatsapp", - } - - if err := wac.connect(); err != nil { - return nil, err - } - - go wac.readPump() - go wac.writePump() - go wac.keepAlive(20000, 60000) - - return wac, nil -} - -func (wac *Conn) isConnected() bool { - wac.wsConnMutex.RLock() - defer wac.wsConnMutex.RUnlock() - if wac.wsConn == nil { - return false - } - if wac.wsConnOK { - return true - } - - // just send a keepalive to test the connection - wac.sendKeepAlive() - - // this method is expected to be called by loops. So we can just return false - return false -} - -// connect should be guarded with wsConnMutex -func (wac *Conn) connect() error { - dialer := &websocket.Dialer{ - ReadBufferSize: 25 * 1024 * 1024, - WriteBufferSize: 10 * 1024 * 1024, - HandshakeTimeout: wac.msgTimeout, - } - - headers := http.Header{"Origin": []string{"https://web.whatsapp.com"}} - wsConn, _, err := dialer.Dial("wss://web.whatsapp.com/ws", headers) - if err != nil { - return fmt.Errorf("couldn't dial whatsapp web websocket: %v", err) - } - - wsConn.SetCloseHandler(func(code int, text string) error { - fmt.Fprintf(os.Stderr, "websocket connection closed(%d, %s)\n", code, text) - - // from default CloseHandler - message := websocket.FormatCloseMessage(code, "") - wsConn.WriteControl(websocket.CloseMessage, message, time.Now().Add(time.Second)) - - // our close handling - if websocket.IsUnexpectedCloseError(err, websocket.CloseNormalClosure, websocket.CloseGoingAway) { - fmt.Println("Trigger reconnect") - go wac.reconnect() - } - return nil - }) - - wac.wsConn = wsConn - wac.wsConnOK = true - return nil -} - -// reconnect should be run as go routine -func (wac *Conn) reconnect() { - wac.wsConnMutex.Lock() - wac.wsConn.Close() - wac.wsConn = nil - wac.wsConnOK = false - wac.wsConnMutex.Unlock() - - // wait up to 60 seconds and then reconnect. As writePump should send immediately, it might - // reconnect as well. So we check its existance before reconnecting - for !wac.isConnected() { - time.Sleep(time.Duration(rand.Intn(60)) * time.Second) - - wac.wsConnMutex.Lock() - if wac.wsConn == nil { - if err := wac.connect(); err != nil { - fmt.Fprintf(os.Stderr, "could not reconnect to websocket: %v\n", err) - } - } - wac.wsConnMutex.Unlock() - } -} - -func (wac *Conn) write(data []interface{}) (<-chan string, error) { - d, err := json.Marshal(data) - if err != nil { - return nil, err - } - - ts := time.Now().Unix() - messageTag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) - msg := fmt.Sprintf("%s,%s", messageTag, d) - - ch := make(chan string, 1) - - wac.listenerMutex.Lock() - wac.listener[messageTag] = ch - wac.listenerMutex.Unlock() - - wac.writeChan <- wsMsg{websocket.TextMessage, []byte(msg)} - - wac.msgCount++ - return ch, nil -} - -func (wac *Conn) writeBinary(node binary.Node, metric metric, flag flag, tag string) (<-chan string, error) { - if len(tag) < 2 { - return nil, fmt.Errorf("no tag specified or to short") - } - b, err := binary.Marshal(node) - if err != nil { - return nil, err - } - - cipher, err := cbc.Encrypt(wac.session.EncKey, nil, b) - if err != nil { - return nil, err - } - - h := hmac.New(sha256.New, wac.session.MacKey) - h.Write(cipher) - hash := h.Sum(nil) - - data := []byte(tag + ",") - data = append(data, byte(metric), byte(flag)) - data = append(data, hash[:32]...) - data = append(data, cipher...) - - ch := make(chan string, 1) - - wac.listenerMutex.Lock() - wac.listener[tag] = ch - wac.listenerMutex.Unlock() - - msg := wsMsg{websocket.BinaryMessage, data} - wac.writeChan <- msg - - wac.msgCount++ - return ch, nil -} - -func (wac *Conn) readPump() { - defer wac.wsConn.Close() - - for { - msgType, msg, err := wac.wsConn.ReadMessage() - if err != nil { - wac.wsConnOK = false - if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway) { - wac.handle(fmt.Errorf("unexpected websocket close: %v", err)) - } - // sleep for a second and retry reading the next message - time.Sleep(time.Second) - continue - } - wac.wsConnOK = true - - data := strings.SplitN(string(msg), ",", 2) - - //Kepp-Alive Timestmap - if data[0][0] == '!' { - msecs, err := strconv.ParseInt(data[0][1:], 10, 64) - if err != nil { - fmt.Fprintf(os.Stderr, "Error converting time string to uint: %v\n", err) - continue - } - wac.ServerLastSeen = time.Unix(msecs/1000, (msecs%1000)*int64(time.Millisecond)) - continue - } - - wac.listenerMutex.RLock() - listener, hasListener := wac.listener[data[0]] - wac.listenerMutex.RUnlock() - - if len(data[1]) == 0 { - continue - } else if hasListener { - listener <- data[1] - - wac.listenerMutex.Lock() - delete(wac.listener, data[0]) - wac.listenerMutex.Unlock() - } else if msgType == 2 && wac.session != nil && wac.session.EncKey != nil { - message, err := wac.decryptBinaryMessage([]byte(data[1])) - if err != nil { - wac.handle(fmt.Errorf("error decoding binary: %v", err)) - continue - } - - wac.dispatch(message) - } else { - wac.handle(string(data[1])) - } - - } -} - -func (wac *Conn) writePump() { - for msg := range wac.writeChan { - for !wac.isConnected() { - // reconnect to send the message ASAP - wac.wsConnMutex.Lock() - if wac.wsConn == nil { - if err := wac.connect(); err != nil { - fmt.Fprintf(os.Stderr, "could not reconnect to websocket: %v\n", err) - } - } - wac.wsConnMutex.Unlock() - if !wac.isConnected() { - // reconnecting failed. Sleep for a while and try again afterwards - time.Sleep(time.Duration(rand.Intn(5)) * time.Second) - } - } - if err := wac.wsConn.WriteMessage(msg.messageType, msg.data); err != nil { - fmt.Fprintf(os.Stderr, "error writing to socket: %v\n", err) - wac.wsConnOK = false - // add message to channel again to no loose it - go func() { - wac.writeChan <- msg - }() - } - } -} - -func (wac *Conn) sendKeepAlive() { - // whatever issues might be there allow sending this message - wac.wsConnOK = true - wac.writeChan <- wsMsg{ - messageType: websocket.TextMessage, - data: []byte("?,,"), - } -} - -func (wac *Conn) keepAlive(minIntervalMs int, maxIntervalMs int) { - for { - wac.sendKeepAlive() - interval := rand.Intn(maxIntervalMs-minIntervalMs) + minIntervalMs - <-time.After(time.Duration(interval) * time.Millisecond) - } -} - -func (wac *Conn) decryptBinaryMessage(msg []byte) (*binary.Node, error) { - //message validation - h2 := hmac.New(sha256.New, wac.session.MacKey) - h2.Write([]byte(msg[32:])) - if !hmac.Equal(h2.Sum(nil), msg[:32]) { - return nil, fmt.Errorf("message received with invalid hmac") - } - - // message decrypt - d, err := cbc.Decrypt(wac.session.EncKey, nil, msg[32:]) - if err != nil { - return nil, fmt.Errorf("error decrypting message with AES: %v", err) - } - - // message unmarshal - message, err := binary.Unmarshal(d) - if err != nil { - return nil, fmt.Errorf("error decoding binary: %v", err) - } - - return message, nil -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/contact.go b/vendor/github.com/matterbridge/go-whatsapp/contact.go deleted file mode 100644 index 5073608e..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/contact.go +++ /dev/null @@ -1,234 +0,0 @@ -package whatsapp - -import ( - "fmt" - "github.com/matterbridge/go-whatsapp/binary" - "strconv" - "time" -) - -type Presence string - -const ( - PresenceAvailable = "available" - PresenceUnavailable = "unavailable" - PresenceComposing = "composing" - PresenceRecording = "recording" - PresencePaused = "paused" -) - -//TODO: filename? WhatsApp uses Store.Contacts for these functions -//TODO: functions probably shouldn't return a string, maybe build a struct / return json -//TODO: check for further queries -func (wac *Conn) GetProfilePicThumb(jid string) (<-chan string, error) { - data := []interface{}{"query", "ProfilePicThumb", jid} - return wac.write(data) -} - -func (wac *Conn) GetStatus(jid string) (<-chan string, error) { - data := []interface{}{"query", "Status", jid} - return wac.write(data) -} - -func (wac *Conn) SubscribePresence(jid string) (<-chan string, error) { - data := []interface{}{"action", "presence", "subscribe", jid} - return wac.write(data) -} - -func (wac *Conn) Search(search string, count, page int) (*binary.Node, error) { - return wac.query("search", "", "", "", "", search, count, page) -} - -func (wac *Conn) LoadMessages(jid, messageId string, count int) (*binary.Node, error) { - return wac.query("message", jid, "", "before", "true", "", count, 0) -} - -func (wac *Conn) LoadMessagesBefore(jid, messageId string, count int) (*binary.Node, error) { - return wac.query("message", jid, messageId, "before", "true", "", count, 0) -} - -func (wac *Conn) LoadMessagesAfter(jid, messageId string, count int) (*binary.Node, error) { - return wac.query("message", jid, messageId, "after", "true", "", count, 0) -} - -func (wac *Conn) Presence(jid string, presence Presence) (<-chan string, error) { - ts := time.Now().Unix() - tag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) - - content := binary.Node{ - Description: "presence", - Attributes: map[string]string{ - "type": string(presence), - }, - } - switch presence { - case PresenceComposing: - fallthrough - case PresenceRecording: - fallthrough - case PresencePaused: - content.Attributes["to"] = jid - } - - n := binary.Node{ - Description: "action", - Attributes: map[string]string{ - "type": "set", - "epoch": strconv.Itoa(wac.msgCount), - }, - Content: []interface{}{content}, - } - - return wac.writeBinary(n, group, ignore, tag) -} - -func (wac *Conn) Exist(jid string) (<-chan string, error) { - data := []interface{}{"query", "exist", jid} - return wac.write(data) -} - -func (wac *Conn) Emoji() (*binary.Node, error) { - return wac.query("emoji", "", "", "", "", "", 0, 0) -} - -func (wac *Conn) Contacts() (*binary.Node, error) { - return wac.query("contacts", "", "", "", "", "", 0, 0) -} - -func (wac *Conn) Chats() (*binary.Node, error) { - return wac.query("chat", "", "", "", "", "", 0, 0) -} - -func (wac *Conn) Read(jid, id string) (<-chan string, error) { - ts := time.Now().Unix() - tag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) - - n := binary.Node{ - Description: "action", - Attributes: map[string]string{ - "type": "set", - "epoch": strconv.Itoa(wac.msgCount), - }, - Content: []interface{}{binary.Node{ - Description: "read", - Attributes: map[string]string{ - "count": "1", - "index": id, - "jid": jid, - "owner": "false", - }, - }}, - } - - return wac.writeBinary(n, group, ignore, tag) -} - -func (wac *Conn) query(t, jid, messageId, kind, owner, search string, count, page int) (*binary.Node, error) { - ts := time.Now().Unix() - tag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) - - n := binary.Node{ - Description: "query", - Attributes: map[string]string{ - "type": t, - "epoch": strconv.Itoa(wac.msgCount), - }, - } - - if jid != "" { - n.Attributes["jid"] = jid - } - - if messageId != "" { - n.Attributes["index"] = messageId - } - - if kind != "" { - n.Attributes["kind"] = kind - } - - if owner != "" { - n.Attributes["owner"] = owner - } - - if search != "" { - n.Attributes["search"] = search - } - - if count != 0 { - n.Attributes["count"] = strconv.Itoa(count) - } - - if page != 0 { - n.Attributes["page"] = strconv.Itoa(page) - } - - ch, err := wac.writeBinary(n, group, ignore, tag) - if err != nil { - return nil, err - } - - msg, err := wac.decryptBinaryMessage([]byte(<-ch)) - if err != nil { - return nil, err - } - - //TODO: use parseProtoMessage - return msg, nil -} - -func (wac *Conn) setGroup(t, jid, subject string, participants []string) (<-chan string, error) { - ts := time.Now().Unix() - tag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) - - //TODO: get proto or improve encoder to handle []interface{} - - p := buildParticipantNodes(participants) - - g := binary.Node{ - Description: "group", - Attributes: map[string]string{ - "author": wac.session.Wid, - "id": tag, - "type": t, - }, - Content: p, - } - - if jid != "" { - g.Attributes["jid"] = jid - } - - if subject != "" { - g.Attributes["subject"] = subject - } - - n := binary.Node{ - Description: "action", - Attributes: map[string]string{ - "type": "set", - "epoch": strconv.Itoa(wac.msgCount), - }, - Content: []interface{}{g}, - } - - return wac.writeBinary(n, group, ignore, tag) -} - -func buildParticipantNodes(participants []string) []binary.Node { - l := len(participants) - if participants == nil || l == 0 { - return nil - } - - p := make([]binary.Node, len(participants)) - for i, participant := range participants { - p[i] = binary.Node{ - Description: "participant", - Attributes: map[string]string{ - "jid": participant, - }, - } - } - return p -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/crypto/cbc/cbc.go b/vendor/github.com/matterbridge/go-whatsapp/crypto/cbc/cbc.go deleted file mode 100644 index cc5427c3..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/crypto/cbc/cbc.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -CBC describes a block cipher mode. In cryptography, a block cipher mode of operation is an algorithm that uses a -block cipher to provide an information service such as confidentiality or authenticity. A block cipher by itself -is only suitable for the secure cryptographic transformation (encryption or decryption) of one fixed-length group of -bits called a block. A mode of operation describes how to repeatedly apply a cipher's single-block operation to -securely transform amounts of data larger than a block. - -This package simplifies the usage of AES-256-CBC. -*/ -package cbc - -/* -Some code is provided by the GitHub user locked (github.com/locked): -https://gist.github.com/locked/b066aa1ddeb2b28e855e -Thanks! -*/ -import ( - "bytes" - "crypto/aes" - "crypto/cipher" - "crypto/rand" - "fmt" - "io" -) - -/* -Decrypt is a function that decrypts a given cipher text with a provided key and initialization vector(iv). -*/ -func Decrypt(key, iv, ciphertext []byte) ([]byte, error) { - block, err := aes.NewCipher(key) - - if err != nil { - return nil, err - } - - if len(ciphertext) < aes.BlockSize { - return nil, fmt.Errorf("ciphertext is shorter then block size: %d / %d", len(ciphertext), aes.BlockSize) - } - - if iv == nil { - iv = ciphertext[:aes.BlockSize] - ciphertext = ciphertext[aes.BlockSize:] - } - - cbc := cipher.NewCBCDecrypter(block, iv) - cbc.CryptBlocks(ciphertext, ciphertext) - - return unpad(ciphertext) -} - -/* -Encrypt is a function that encrypts plaintext with a given key and an optional initialization vector(iv). -*/ -func Encrypt(key, iv, plaintext []byte) ([]byte, error) { - plaintext = pad(plaintext, aes.BlockSize) - - if len(plaintext)%aes.BlockSize != 0 { - return nil, fmt.Errorf("plaintext is not a multiple of the block size: %d / %d", len(plaintext), aes.BlockSize) - } - - block, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - - var ciphertext []byte - if iv == nil { - ciphertext = make([]byte, aes.BlockSize+len(plaintext)) - iv := ciphertext[:aes.BlockSize] - if _, err := io.ReadFull(rand.Reader, iv); err != nil { - return nil, err - } - - cbc := cipher.NewCBCEncrypter(block, iv) - cbc.CryptBlocks(ciphertext[aes.BlockSize:], plaintext) - } else { - ciphertext = make([]byte, len(plaintext)) - - cbc := cipher.NewCBCEncrypter(block, iv) - cbc.CryptBlocks(ciphertext, plaintext) - } - - return ciphertext, nil -} - -func pad(ciphertext []byte, blockSize int) []byte { - padding := blockSize - len(ciphertext)%blockSize - padtext := bytes.Repeat([]byte{byte(padding)}, padding) - return append(ciphertext, padtext...) -} - -func unpad(src []byte) ([]byte, error) { - length := len(src) - padLen := int(src[length-1]) - - if padLen > length { - return nil, fmt.Errorf("padding is greater then the length: %d / %d", padLen, length) - } - - return src[:(length - padLen)], nil -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/crypto/curve25519/curve.go b/vendor/github.com/matterbridge/go-whatsapp/crypto/curve25519/curve.go deleted file mode 100644 index 5ddf9c9a..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/crypto/curve25519/curve.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -In cryptography, Curve25519 is an elliptic curve offering 128 bits of security and designed for use with the elliptic -curve Diffie–Hellman (ECDH) key agreement scheme. It is one of the fastest ECC curves and is not covered by any known -patents. The reference implementation is public domain software. The original Curve25519 paper defined it -as a Diffie–Hellman (DH) function. -*/ -package curve25519 - -import ( - "crypto/rand" - "golang.org/x/crypto/curve25519" - "io" -) - -/* -GenerateKey generates a public private key pair using Curve25519. -*/ -func GenerateKey() (privateKey *[32]byte, publicKey *[32]byte, err error) { - var pub, priv [32]byte - - _, err = io.ReadFull(rand.Reader, priv[:]) - if err != nil { - return nil, nil, err - } - - priv[0] &= 248 - priv[31] &= 127 - priv[31] |= 64 - - curve25519.ScalarBaseMult(&pub, &priv) - - return &priv, &pub, nil -} - -/* -GenerateSharedSecret generates the shared secret with a given public private key pair. -*/ -func GenerateSharedSecret(priv, pub [32]byte) []byte { - var secret [32]byte - - curve25519.ScalarMult(&secret, &priv, &pub) - - return secret[:] -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/crypto/hkdf/hkdf.go b/vendor/github.com/matterbridge/go-whatsapp/crypto/hkdf/hkdf.go deleted file mode 100644 index e0be0587..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/crypto/hkdf/hkdf.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -HKDF is a simple key derivation function (KDF) based on -a hash-based message authentication code (HMAC). It was initially proposed by its authors as a building block in -various protocols and applications, as well as to discourage the proliferation of multiple KDF mechanisms. -The main approach HKDF follows is the "extract-then-expand" paradigm, where the KDF logically consists of two modules: -the first stage takes the input keying material and "extracts" from it a fixed-length pseudorandom key, and then the -second stage "expands" this key into several additional pseudorandom keys (the output of the KDF). -*/ -package hkdf - -import ( - "crypto/hmac" - "crypto/sha256" - "fmt" - "golang.org/x/crypto/hkdf" - "io" -) - -/* -Expand expands a given key with the HKDF algorithm. -*/ -func Expand(key []byte, length int, info string) ([]byte, error) { - if info == "" { - keyBlock := hmac.New(sha256.New, key) - var out, last []byte - - var blockIndex byte = 1 - for i := 0; len(out) < length; i++ { - keyBlock.Reset() - //keyBlock.Write(append(append(last, []byte(info)...), blockIndex)) - keyBlock.Write(last) - keyBlock.Write([]byte(info)) - keyBlock.Write([]byte{blockIndex}) - last = keyBlock.Sum(nil) - blockIndex += 1 - out = append(out, last...) - } - return out[:length], nil - } else { - h := hkdf.New(sha256.New, key, nil, []byte(info)) - out := make([]byte, length) - n, err := io.ReadAtLeast(h, out, length) - if err != nil { - return nil, err - } - if n != length { - return nil, fmt.Errorf("new key to short") - } - - return out[:length], nil - } -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/go.mod b/vendor/github.com/matterbridge/go-whatsapp/go.mod deleted file mode 100644 index 2c2afb6d..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/matterbridge/go-whatsapp - -require ( - github.com/golang/protobuf v1.2.0 - github.com/gorilla/websocket v1.4.0 - golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613 - golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect -) diff --git a/vendor/github.com/matterbridge/go-whatsapp/go.sum b/vendor/github.com/matterbridge/go-whatsapp/go.sum deleted file mode 100644 index e4fd3944..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/go.sum +++ /dev/null @@ -1,7 +0,0 @@ -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613 h1:MQ/ZZiDsUapFFiMS+vzwXkCTeEKaum+Do5rINYJDmxc= -golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/vendor/github.com/matterbridge/go-whatsapp/group.go b/vendor/github.com/matterbridge/go-whatsapp/group.go deleted file mode 100644 index 432ba457..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/group.go +++ /dev/null @@ -1,65 +0,0 @@ -package whatsapp - -import ( - "encoding/json" - "fmt" - "time" -) - -func (wac *Conn) GetGroupMetaData(jid string) (<-chan string, error) { - data := []interface{}{"query", "GroupMetadata", jid} - return wac.write(data) -} - -func (wac *Conn) CreateGroup(subject string, participants []string) (<-chan string, error) { - return wac.setGroup("create", "", subject, participants) -} - -func (wac *Conn) UpdateGroupSubject(subject string, jid string) (<-chan string, error) { - return wac.setGroup("subject", jid, subject, nil) -} - -func (wac *Conn) SetAdmin(jid string, participants []string) (<-chan string, error) { - return wac.setGroup("promote", jid, "", participants) -} - -func (wac *Conn) RemoveAdmin(jid string, participants []string) (<-chan string, error) { - return wac.setGroup("demote", jid, "", participants) -} - -func (wac *Conn) AddMember(jid string, participants []string) (<-chan string, error) { - return wac.setGroup("add", jid, "", participants) -} - -func (wac *Conn) RemoveMember(jid string, participants []string) (<-chan string, error) { - return wac.setGroup("remove", jid, "", participants) -} - -func (wac *Conn) LeaveGroup(jid string) (<-chan string, error) { - return wac.setGroup("leave", jid, "", nil) -} - -func (wac *Conn) GroupInviteLink(jid string) (string, error) { - request := []interface{}{"query", "inviteCode", jid} - ch, err := wac.write(request) - if err != nil { - return "", err - } - - var response map[string]interface{} - - select { - case r := <-ch: - if err := json.Unmarshal([]byte(r), &response); err != nil { - return "", fmt.Errorf("error decoding response message: %v\n", err) - } - case <-time.After(wac.msgTimeout): - return "", fmt.Errorf("request timed out") - } - - if int(response["status"].(float64)) != 200 { - return "", fmt.Errorf("request responded with %d", response["status"]) - } - - return response["code"].(string), nil -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/handler.go b/vendor/github.com/matterbridge/go-whatsapp/handler.go deleted file mode 100644 index 330356f0..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/handler.go +++ /dev/null @@ -1,169 +0,0 @@ -package whatsapp - -import ( - "fmt" - "github.com/matterbridge/go-whatsapp/binary" - "github.com/matterbridge/go-whatsapp/binary/proto" - "os" -) - -/* -The Handler interface is the minimal interface that needs to be implemented -to be accepted as a valid handler for our dispatching system. -The minimal handler is used to dispatch error messages. These errors occur on unexpected behavior by the websocket -connection or if we are unable to handle or interpret an incoming message. Error produced by user actions are not -dispatched through this handler. They are returned as an error on the specific function call. -*/ -type Handler interface { - HandleError(err error) -} - -/* -The TextMessageHandler interface needs to be implemented to receive text messages dispatched by the dispatcher. -*/ -type TextMessageHandler interface { - Handler - HandleTextMessage(message TextMessage) -} - -/* -The ImageMessageHandler interface needs to be implemented to receive image messages dispatched by the dispatcher. -*/ -type ImageMessageHandler interface { - Handler - HandleImageMessage(message ImageMessage) -} - -/* -The VideoMessageHandler interface needs to be implemented to receive video messages dispatched by the dispatcher. -*/ -type VideoMessageHandler interface { - Handler - HandleVideoMessage(message VideoMessage) -} - -/* -The AudioMessageHandler interface needs to be implemented to receive audio messages dispatched by the dispatcher. -*/ -type AudioMessageHandler interface { - Handler - HandleAudioMessage(message AudioMessage) -} - -/* -The DocumentMessageHandler interface needs to be implemented to receive document messages dispatched by the dispatcher. -*/ -type DocumentMessageHandler interface { - Handler - HandleDocumentMessage(message DocumentMessage) -} - -/* -The JsonMessageHandler interface needs to be implemented to receive json messages dispatched by the dispatcher. -These json messages contain status updates of every kind sent by WhatsAppWeb servers. WhatsAppWeb uses these messages -to built a Store, which is used to save these "secondary" information. These messages may contain -presence (available, last see) information, or just the battery status of your phone. -*/ -type JsonMessageHandler interface { - Handler - HandleJsonMessage(message string) -} - -/** -The RawMessageHandler interface needs to be implemented to receive raw messages dispatched by the dispatcher. -Raw messages are the raw protobuf structs instead of the easy-to-use structs in TextMessageHandler, ImageMessageHandler, etc.. -*/ -type RawMessageHandler interface { - Handler - HandleRawMessage(message *proto.WebMessageInfo) -} - -/* -AddHandler adds an handler to the list of handler that receive dispatched messages. -The provided handler must at least implement the Handler interface. Additionally implemented -handlers(TextMessageHandler, ImageMessageHandler) are optional. At runtime it is checked if they are implemented -and they are called if so and needed. -*/ -func (wac *Conn) AddHandler(handler Handler) { - wac.handler = append(wac.handler, handler) -} - -func (wac *Conn) handle(message interface{}) { - switch m := message.(type) { - case error: - for _, h := range wac.handler { - go h.HandleError(m) - } - case string: - for _, h := range wac.handler { - if x, ok := h.(JsonMessageHandler); ok { - go x.HandleJsonMessage(m) - } - } - case TextMessage: - for _, h := range wac.handler { - if x, ok := h.(TextMessageHandler); ok { - go x.HandleTextMessage(m) - } - } - case ImageMessage: - for _, h := range wac.handler { - if x, ok := h.(ImageMessageHandler); ok { - go x.HandleImageMessage(m) - } - } - case VideoMessage: - for _, h := range wac.handler { - if x, ok := h.(VideoMessageHandler); ok { - go x.HandleVideoMessage(m) - } - } - case AudioMessage: - for _, h := range wac.handler { - if x, ok := h.(AudioMessageHandler); ok { - go x.HandleAudioMessage(m) - } - } - case DocumentMessage: - for _, h := range wac.handler { - if x, ok := h.(DocumentMessageHandler); ok { - go x.HandleDocumentMessage(m) - } - } - case *proto.WebMessageInfo: - for _, h := range wac.handler { - if x, ok := h.(RawMessageHandler); ok { - go x.HandleRawMessage(m) - } - } - } - -} - -func (wac *Conn) dispatch(msg interface{}) { - if msg == nil { - return - } - - switch message := msg.(type) { - case *binary.Node: - if message.Description == "action" { - if con, ok := message.Content.([]interface{}); ok { - for a := range con { - if v, ok := con[a].(*proto.WebMessageInfo); ok { - wac.handle(v) - wac.handle(parseProtoMessage(v)) - } - } - } - } else if message.Description == "response" && message.Attributes["type"] == "contacts" { - wac.updateContacts(message.Content) - } - case error: - wac.handle(message) - case string: - wac.handle(message) - default: - fmt.Fprintf(os.Stderr, "unknown type in dipatcher chan: %T", msg) - } -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/media.go b/vendor/github.com/matterbridge/go-whatsapp/media.go deleted file mode 100644 index 9fcc08e2..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/media.go +++ /dev/null @@ -1,199 +0,0 @@ -package whatsapp - -import ( - "bytes" - "crypto/hmac" - "crypto/rand" - "crypto/sha256" - "encoding/base64" - "encoding/json" - "fmt" - "github.com/matterbridge/go-whatsapp/crypto/cbc" - "github.com/matterbridge/go-whatsapp/crypto/hkdf" - "io" - "io/ioutil" - "mime/multipart" - "net/http" - "os" - "strings" - "time" -) - -func Download(url string, mediaKey []byte, appInfo MediaType, fileLength int) ([]byte, error) { - if url == "" { - return nil, fmt.Errorf("no url present") - } - file, mac, err := downloadMedia(url) - if err != nil { - return nil, err - } - iv, cipherKey, macKey, _, err := getMediaKeys(mediaKey, appInfo) - if err != nil { - return nil, err - } - if err = validateMedia(iv, file, macKey, mac); err != nil { - return nil, err - } - data, err := cbc.Decrypt(cipherKey, iv, file) - if err != nil { - return nil, err - } - if len(data) != fileLength { - return nil, fmt.Errorf("file length does not match") - } - return data, nil -} - -func validateMedia(iv []byte, file []byte, macKey []byte, mac []byte) error { - h := hmac.New(sha256.New, macKey) - n, err := h.Write(append(iv, file...)) - if err != nil { - return err - } - if n < 10 { - return fmt.Errorf("hash to short") - } - if !hmac.Equal(h.Sum(nil)[:10], mac) { - return fmt.Errorf("invalid media hmac") - } - return nil -} - -func getMediaKeys(mediaKey []byte, appInfo MediaType) (iv, cipherKey, macKey, refKey []byte, err error) { - mediaKeyExpanded, err := hkdf.Expand(mediaKey, 112, string(appInfo)) - if err != nil { - return nil, nil, nil, nil, err - } - return mediaKeyExpanded[:16], mediaKeyExpanded[16:48], mediaKeyExpanded[48:80], mediaKeyExpanded[80:], nil -} - -func downloadMedia(url string) (file []byte, mac []byte, err error) { - resp, err := http.Get(url) - if err != nil { - return nil, nil, err - } - if resp.StatusCode != 200 { - return nil, nil, fmt.Errorf("download failed") - } - defer resp.Body.Close() - if resp.ContentLength <= 10 { - return nil, nil, fmt.Errorf("file to short") - } - data, err := ioutil.ReadAll(resp.Body) - n := len(data) - if err != nil { - return nil, nil, err - } - return data[:n-10], data[n-10 : n], nil -} - -func (wac *Conn) Upload(reader io.Reader, appInfo MediaType) (url string, mediaKey []byte, fileEncSha256 []byte, fileSha256 []byte, fileLength uint64, err error) { - data, err := ioutil.ReadAll(reader) - if err != nil { - return "", nil, nil, nil, 0, err - } - - mediaKey = make([]byte, 32) - rand.Read(mediaKey) - - iv, cipherKey, macKey, _, err := getMediaKeys(mediaKey, appInfo) - if err != nil { - return "", nil, nil, nil, 0, err - } - - enc, err := cbc.Encrypt(cipherKey, iv, data) - if err != nil { - return "", nil, nil, nil, 0, err - } - - fileLength = uint64(len(data)) - - h := hmac.New(sha256.New, macKey) - h.Write(append(iv, enc...)) - mac := h.Sum(nil)[:10] - - sha := sha256.New() - sha.Write(data) - fileSha256 = sha.Sum(nil) - - sha.Reset() - sha.Write(append(enc, mac...)) - fileEncSha256 = sha.Sum(nil) - - var filetype string - switch appInfo { - case MediaImage: - filetype = "image" - case MediaAudio: - filetype = "audio" - case MediaDocument: - filetype = "document" - case MediaVideo: - filetype = "video" - } - - uploadReq := []interface{}{"action", "encr_upload", filetype, base64.StdEncoding.EncodeToString(fileEncSha256)} - ch, err := wac.write(uploadReq) - if err != nil { - return "", nil, nil, nil, 0, err - } - - var resp map[string]interface{} - select { - case r := <-ch: - if err = json.Unmarshal([]byte(r), &resp); err != nil { - return "", nil, nil, nil, 0, fmt.Errorf("error decoding upload response: %v\n", err) - } - case <-time.After(wac.msgTimeout): - return "", nil, nil, nil, 0, fmt.Errorf("restore session init timed out") - } - - if int(resp["status"].(float64)) != 200 { - return "", nil, nil, nil, 0, fmt.Errorf("upload responsed with %d", resp["status"]) - } - - var b bytes.Buffer - w := multipart.NewWriter(&b) - hashWriter, err := w.CreateFormField("hash") - if err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - } - io.Copy(hashWriter, strings.NewReader(base64.StdEncoding.EncodeToString(fileEncSha256))) - - fileWriter, err := w.CreateFormFile("file", "blob") - if err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - } - io.Copy(fileWriter, bytes.NewReader(append(enc, mac...))) - err = w.Close() - if err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - } - - req, err := http.NewRequest("POST", resp["url"].(string), &b) - if err != nil { - return "", nil, nil, nil, 0, err - } - - req.Header.Set("Content-Type", w.FormDataContentType()) - req.Header.Set("Origin", "https://web.whatsapp.com") - req.Header.Set("Referer", "https://web.whatsapp.com/") - - req.URL.Query().Set("f", "j") - - client := &http.Client{} - // Submit the request - res, err := client.Do(req) - if err != nil { - return "", nil, nil, nil, 0, err - } - - if res.StatusCode != http.StatusOK { - return "", nil, nil, nil, 0, fmt.Errorf("upload failed with status code %d", res.StatusCode) - } - - var jsonRes map[string]string - json.NewDecoder(res.Body).Decode(&jsonRes) - - return jsonRes["url"], mediaKey, fileEncSha256, fileSha256, fileLength, nil -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/message.go b/vendor/github.com/matterbridge/go-whatsapp/message.go deleted file mode 100644 index 7e099b9d..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/message.go +++ /dev/null @@ -1,444 +0,0 @@ -package whatsapp - -import ( - "encoding/hex" - "encoding/json" - "fmt" - "github.com/matterbridge/go-whatsapp/binary" - "github.com/matterbridge/go-whatsapp/binary/proto" - "io" - "math/rand" - "strconv" - "strings" - "time" -) - -type MediaType string - -const ( - MediaImage MediaType = "WhatsApp Image Keys" - MediaVideo MediaType = "WhatsApp Video Keys" - MediaAudio MediaType = "WhatsApp Audio Keys" - MediaDocument MediaType = "WhatsApp Document Keys" -) - -func (wac *Conn) Send(msg interface{}) error { - var err error - var ch <-chan string - - switch m := msg.(type) { - case *proto.WebMessageInfo: - ch, err = wac.sendProto(m) - case TextMessage: - ch, err = wac.sendProto(getTextProto(m)) - case ImageMessage: - m.url, m.mediaKey, m.fileEncSha256, m.fileSha256, m.fileLength, err = wac.Upload(m.Content, MediaImage) - if err != nil { - return fmt.Errorf("image upload failed: %v", err) - } - ch, err = wac.sendProto(getImageProto(m)) - case VideoMessage: - m.url, m.mediaKey, m.fileEncSha256, m.fileSha256, m.fileLength, err = wac.Upload(m.Content, MediaVideo) - if err != nil { - return fmt.Errorf("video upload failed: %v", err) - } - ch, err = wac.sendProto(getVideoProto(m)) - case DocumentMessage: - m.url, m.mediaKey, m.fileEncSha256, m.fileSha256, m.fileLength, err = wac.Upload(m.Content, MediaDocument) - if err != nil { - return fmt.Errorf("document upload failed: %v", err) - } - ch, err = wac.sendProto(getDocumentProto(m)) - case AudioMessage: - m.url, m.mediaKey, m.fileEncSha256, m.fileSha256, m.fileLength, err = wac.Upload(m.Content, MediaAudio) - if err != nil { - return fmt.Errorf("audio upload failed: %v", err) - } - ch, err = wac.sendProto(getAudioProto(m)) - default: - return fmt.Errorf("cannot match type %T, use message types declared in the package", msg) - } - - if err != nil { - return fmt.Errorf("could not send proto: %v", err) - } - - select { - case response := <-ch: - var resp map[string]interface{} - if err = json.Unmarshal([]byte(response), &resp); err != nil { - return fmt.Errorf("error decoding sending response: %v\n", err) - } - if int(resp["status"].(float64)) != 200 { - return fmt.Errorf("message sending responded with %d", resp["status"]) - } - case <-time.After(wac.msgTimeout): - return fmt.Errorf("sending message timed out") - } - - return nil -} - -func (wac *Conn) sendProto(p *proto.WebMessageInfo) (<-chan string, error) { - n := binary.Node{ - Description: "action", - Attributes: map[string]string{ - "type": "relay", - "epoch": strconv.Itoa(wac.msgCount), - }, - Content: []interface{}{p}, - } - return wac.writeBinary(n, message, ignore, p.Key.GetId()) -} - -func init() { - rand.Seed(time.Now().UTC().UnixNano()) -} - -/* -MessageInfo contains general message information. It is part of every of every message type. -*/ -type MessageInfo struct { - Id string - RemoteJid string - SenderJid string - FromMe bool - Timestamp uint64 - PushName string - Status MessageStatus - QuotedMessageID string - - Source *proto.WebMessageInfo -} - -type MessageStatus int - -const ( - Error MessageStatus = 0 - Pending = 1 - ServerAck = 2 - DeliveryAck = 3 - Read = 4 - Played = 5 -) - -func getMessageInfo(msg *proto.WebMessageInfo) MessageInfo { - return MessageInfo{ - Id: msg.GetKey().GetId(), - RemoteJid: msg.GetKey().GetRemoteJid(), - SenderJid: msg.GetKey().GetParticipant(), - FromMe: msg.GetKey().GetFromMe(), - Timestamp: msg.GetMessageTimestamp(), - Status: MessageStatus(msg.GetStatus()), - PushName: msg.GetPushName(), - Source: msg, - } -} - -func getInfoProto(info *MessageInfo) *proto.WebMessageInfo { - if info.Id == "" || len(info.Id) < 2 { - b := make([]byte, 10) - rand.Read(b) - info.Id = strings.ToUpper(hex.EncodeToString(b)) - } - if info.Timestamp == 0 { - info.Timestamp = uint64(time.Now().Unix()) - } - info.FromMe = true - - status := proto.WebMessageInfo_STATUS(info.Status) - - return &proto.WebMessageInfo{ - Key: &proto.MessageKey{ - FromMe: &info.FromMe, - RemoteJid: &info.RemoteJid, - Id: &info.Id, - }, - MessageTimestamp: &info.Timestamp, - Status: &status, - } -} - -/* -TextMessage represents a text message. -*/ -type TextMessage struct { - Info MessageInfo - Text string -} - -func getTextMessage(msg *proto.WebMessageInfo) TextMessage { - text := TextMessage{Info: getMessageInfo(msg)} - if m := msg.GetMessage().GetExtendedTextMessage(); m != nil { - text.Text = m.GetText() - text.Info.QuotedMessageID = m.GetContextInfo().GetStanzaId() - } else { - text.Text = msg.GetMessage().GetConversation() - } - return text -} - -func getTextProto(msg TextMessage) *proto.WebMessageInfo { - p := getInfoProto(&msg.Info) - p.Message = &proto.Message{ - Conversation: &msg.Text, - } - return p -} - -/* -ImageMessage represents a image message. Unexported fields are needed for media up/downloading and media validation. -Provide a io.Reader as Content for message sending. -*/ -type ImageMessage struct { - Info MessageInfo - Caption string - Thumbnail []byte - Type string - Content io.Reader - url string - mediaKey []byte - fileEncSha256 []byte - fileSha256 []byte - fileLength uint64 -} - -func getImageMessage(msg *proto.WebMessageInfo) ImageMessage { - image := msg.GetMessage().GetImageMessage() - return ImageMessage{ - Info: getMessageInfo(msg), - Caption: image.GetCaption(), - Thumbnail: image.GetJpegThumbnail(), - url: image.GetUrl(), - mediaKey: image.GetMediaKey(), - Type: image.GetMimetype(), - fileEncSha256: image.GetFileEncSha256(), - fileSha256: image.GetFileSha256(), - fileLength: image.GetFileLength(), - } -} - -func getImageProto(msg ImageMessage) *proto.WebMessageInfo { - p := getInfoProto(&msg.Info) - p.Message = &proto.Message{ - ImageMessage: &proto.ImageMessage{ - Caption: &msg.Caption, - JpegThumbnail: msg.Thumbnail, - Url: &msg.url, - MediaKey: msg.mediaKey, - Mimetype: &msg.Type, - FileEncSha256: msg.fileEncSha256, - FileSha256: msg.fileSha256, - FileLength: &msg.fileLength, - }, - } - return p -} - -/* -Download is the function to retrieve media data. The media gets downloaded, validated and returned. -*/ -func (m *ImageMessage) Download() ([]byte, error) { - return Download(m.url, m.mediaKey, MediaImage, int(m.fileLength)) -} - -/* -VideoMessage represents a video message. Unexported fields are needed for media up/downloading and media validation. -Provide a io.Reader as Content for message sending. -*/ -type VideoMessage struct { - Info MessageInfo - Caption string - Thumbnail []byte - Length uint32 - Type string - Content io.Reader - url string - mediaKey []byte - fileEncSha256 []byte - fileSha256 []byte - fileLength uint64 -} - -func getVideoMessage(msg *proto.WebMessageInfo) VideoMessage { - vid := msg.GetMessage().GetVideoMessage() - return VideoMessage{ - Info: getMessageInfo(msg), - Caption: vid.GetCaption(), - Thumbnail: vid.GetJpegThumbnail(), - url: vid.GetUrl(), - mediaKey: vid.GetMediaKey(), - Length: vid.GetSeconds(), - Type: vid.GetMimetype(), - fileEncSha256: vid.GetFileEncSha256(), - fileSha256: vid.GetFileSha256(), - fileLength: vid.GetFileLength(), - } -} - -func getVideoProto(msg VideoMessage) *proto.WebMessageInfo { - p := getInfoProto(&msg.Info) - p.Message = &proto.Message{ - VideoMessage: &proto.VideoMessage{ - Caption: &msg.Caption, - JpegThumbnail: msg.Thumbnail, - Url: &msg.url, - MediaKey: msg.mediaKey, - Seconds: &msg.Length, - FileEncSha256: msg.fileEncSha256, - FileSha256: msg.fileSha256, - FileLength: &msg.fileLength, - Mimetype: &msg.Type, - }, - } - return p -} - -/* -Download is the function to retrieve media data. The media gets downloaded, validated and returned. -*/ -func (m *VideoMessage) Download() ([]byte, error) { - return Download(m.url, m.mediaKey, MediaVideo, int(m.fileLength)) -} - -/* -AudioMessage represents a audio message. Unexported fields are needed for media up/downloading and media validation. -Provide a io.Reader as Content for message sending. -*/ -type AudioMessage struct { - Info MessageInfo - Length uint32 - Type string - Content io.Reader - url string - mediaKey []byte - fileEncSha256 []byte - fileSha256 []byte - fileLength uint64 -} - -func getAudioMessage(msg *proto.WebMessageInfo) AudioMessage { - aud := msg.GetMessage().GetAudioMessage() - return AudioMessage{ - Info: getMessageInfo(msg), - url: aud.GetUrl(), - mediaKey: aud.GetMediaKey(), - Length: aud.GetSeconds(), - Type: aud.GetMimetype(), - fileEncSha256: aud.GetFileEncSha256(), - fileSha256: aud.GetFileSha256(), - fileLength: aud.GetFileLength(), - } -} - -func getAudioProto(msg AudioMessage) *proto.WebMessageInfo { - p := getInfoProto(&msg.Info) - p.Message = &proto.Message{ - AudioMessage: &proto.AudioMessage{ - Url: &msg.url, - MediaKey: msg.mediaKey, - Seconds: &msg.Length, - FileEncSha256: msg.fileEncSha256, - FileSha256: msg.fileSha256, - FileLength: &msg.fileLength, - Mimetype: &msg.Type, - }, - } - return p -} - -/* -Download is the function to retrieve media data. The media gets downloaded, validated and returned. -*/ -func (m *AudioMessage) Download() ([]byte, error) { - return Download(m.url, m.mediaKey, MediaAudio, int(m.fileLength)) -} - -/* -DocumentMessage represents a document message. Unexported fields are needed for media up/downloading and media -validation. Provide a io.Reader as Content for message sending. -*/ -type DocumentMessage struct { - Info MessageInfo - Title string - PageCount uint32 - Type string - FileName string - Thumbnail []byte - Content io.Reader - url string - mediaKey []byte - fileEncSha256 []byte - fileSha256 []byte - fileLength uint64 -} - -func getDocumentMessage(msg *proto.WebMessageInfo) DocumentMessage { - doc := msg.GetMessage().GetDocumentMessage() - return DocumentMessage{ - Info: getMessageInfo(msg), - Title: doc.GetTitle(), - PageCount: doc.GetPageCount(), - Type: doc.GetMimetype(), - FileName: doc.GetFileName(), - Thumbnail: doc.GetJpegThumbnail(), - url: doc.GetUrl(), - mediaKey: doc.GetMediaKey(), - fileEncSha256: doc.GetFileEncSha256(), - fileSha256: doc.GetFileSha256(), - fileLength: doc.GetFileLength(), - } -} - -func getDocumentProto(msg DocumentMessage) *proto.WebMessageInfo { - p := getInfoProto(&msg.Info) - p.Message = &proto.Message{ - DocumentMessage: &proto.DocumentMessage{ - JpegThumbnail: msg.Thumbnail, - Url: &msg.url, - MediaKey: msg.mediaKey, - FileEncSha256: msg.fileEncSha256, - FileSha256: msg.fileSha256, - FileLength: &msg.fileLength, - PageCount: &msg.PageCount, - Title: &msg.Title, - Mimetype: &msg.Type, - }, - } - return p -} - -/* -Download is the function to retrieve media data. The media gets downloaded, validated and returned. -*/ -func (m *DocumentMessage) Download() ([]byte, error) { - return Download(m.url, m.mediaKey, MediaDocument, int(m.fileLength)) -} - -func parseProtoMessage(msg *proto.WebMessageInfo) interface{} { - switch { - - case msg.GetMessage().GetAudioMessage() != nil: - return getAudioMessage(msg) - - case msg.GetMessage().GetImageMessage() != nil: - return getImageMessage(msg) - - case msg.GetMessage().GetVideoMessage() != nil: - return getVideoMessage(msg) - - case msg.GetMessage().GetDocumentMessage() != nil: - return getDocumentMessage(msg) - - case msg.GetMessage().GetConversation() != "": - return getTextMessage(msg) - - case msg.GetMessage().GetExtendedTextMessage() != nil: - return getTextMessage(msg) - - default: - //cannot match message - } - - return nil -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/session.go b/vendor/github.com/matterbridge/go-whatsapp/session.go deleted file mode 100644 index 2dd8d582..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/session.go +++ /dev/null @@ -1,389 +0,0 @@ -package whatsapp - -import ( - "crypto/hmac" - "crypto/rand" - "crypto/sha256" - "encoding/base64" - "encoding/json" - "fmt" - "time" - - "github.com/matterbridge/go-whatsapp/crypto/cbc" - "github.com/matterbridge/go-whatsapp/crypto/curve25519" - "github.com/matterbridge/go-whatsapp/crypto/hkdf" -) - -/* -Session contains session individual information. To be able to resume the connection without scanning the qr code -every time you should save the Session returned by Login and use RestoreSession the next time you want to login. -Every successful created connection returns a new Session. The Session(ClientToken, ServerToken) is altered after -every re-login and should be saved every time. -*/ -type Session struct { - ClientId string - ClientToken string - ServerToken string - EncKey []byte - MacKey []byte - Wid string -} - -type Info struct { - Battery int - Platform string - Connected bool - Pushname string - Wid string - Lc string - Phone *PhoneInfo - Plugged bool - Tos int - Lg string - Is24h bool -} - -type PhoneInfo struct { - Mcc string - Mnc string - OsVersion string - DeviceManufacturer string - DeviceModel string - OsBuildNumber string - WaVersion string -} - -func newInfoFromReq(info map[string]interface{}) *Info { - phoneInfo := info["phone"].(map[string]interface{}) - - ret := &Info{ - Battery: int(info["battery"].(float64)), - Platform: info["platform"].(string), - Connected: info["connected"].(bool), - Pushname: info["pushname"].(string), - Wid: info["wid"].(string), - Lc: info["lc"].(string), - Phone: &PhoneInfo{ - phoneInfo["mcc"].(string), - phoneInfo["mnc"].(string), - phoneInfo["os_version"].(string), - phoneInfo["device_manufacturer"].(string), - phoneInfo["device_model"].(string), - phoneInfo["os_build_number"].(string), - phoneInfo["wa_version"].(string), - }, - Plugged: info["plugged"].(bool), - Lg: info["lg"].(string), - Tos: int(info["tos"].(float64)), - } - - if is24h, ok := info["is24h"]; ok { - ret.Is24h = is24h.(bool) - } - - return ret -} - -/* -SetClientName sets the long and short client names that are sent to WhatsApp when logging in and displayed in the -WhatsApp Web device list. As the values are only sent when logging in, changing them after logging in is not possible. -*/ -func (wac *Conn) SetClientName(long, short string) error { - if wac.session != nil && (wac.session.EncKey != nil || wac.session.MacKey != nil) { - return fmt.Errorf("cannot change client name after logging in") - } - wac.longClientName, wac.shortClientName = long, short - return nil -} - -/* -Login is the function that creates a new whatsapp session and logs you in. If you do not want to scan the qr code -every time, you should save the returned session and use RestoreSession the next time. Login takes a writable channel -as an parameter. This channel is used to push the data represented by the qr code back to the user. The received data -should be displayed as an qr code in a way you prefer. To print a qr code to console you can use: -github.com/Baozisoftware/qrcode-terminal-go Example login procedure: - wac, err := whatsapp.NewConn(5 * time.Second) - if err != nil { - panic(err) - } - - qr := make(chan string) - go func() { - terminal := qrcodeTerminal.New() - terminal.Get(<-qr).Print() - }() - - session, err := wac.Login(qr) - if err != nil { - fmt.Fprintf(os.Stderr, "error during login: %v\n", err) - } - fmt.Printf("login successful, session: %v\n", session) -*/ -func (wac *Conn) Login(qrChan chan<- string) (Session, error) { - session := Session{} - - if wac.session != nil && (wac.session.EncKey != nil || wac.session.MacKey != nil) { - return session, fmt.Errorf("already logged in") - } - - clientId := make([]byte, 16) - _, err := rand.Read(clientId) - if err != nil { - return session, fmt.Errorf("error creating random ClientId: %v", err) - } - - session.ClientId = base64.StdEncoding.EncodeToString(clientId) - //oldVersion=8691 - login := []interface{}{"admin", "init", []int{0, 3, 225}, []string{wac.longClientName, wac.shortClientName}, session.ClientId, true} - loginChan, err := wac.write(login) - if err != nil { - return session, fmt.Errorf("error writing login: %v\n", err) - } - - var r string - select { - case r = <-loginChan: - case <-time.After(wac.msgTimeout): - return session, fmt.Errorf("login connection timed out") - } - - var resp map[string]interface{} - if err = json.Unmarshal([]byte(r), &resp); err != nil { - return session, fmt.Errorf("error decoding login resp: %v\n", err) - } - - ref := resp["ref"].(string) - - priv, pub, err := curve25519.GenerateKey() - if err != nil { - return session, fmt.Errorf("error generating keys: %v\n", err) - } - - //listener for Login response - messageTag := "s1" - wac.listener[messageTag] = make(chan string, 1) - - qrChan <- fmt.Sprintf("%v,%v,%v", ref, base64.StdEncoding.EncodeToString(pub[:]), session.ClientId) - - var resp2 []interface{} - select { - case r1 := <-wac.listener[messageTag]: - if err := json.Unmarshal([]byte(r1), &resp2); err != nil { - return session, fmt.Errorf("error decoding qr code resp: %v", err) - } - case <-time.After(time.Duration(resp["ttl"].(float64)) * time.Millisecond): - return session, fmt.Errorf("qr code scan timed out") - } - - info := resp2[1].(map[string]interface{}) - - wac.Info = newInfoFromReq(info) - - session.ClientToken = info["clientToken"].(string) - session.ServerToken = info["serverToken"].(string) - session.Wid = info["wid"].(string) - s := info["secret"].(string) - decodedSecret, err := base64.StdEncoding.DecodeString(s) - if err != nil { - return session, fmt.Errorf("error decoding secret: %v", err) - } - - var pubKey [32]byte - copy(pubKey[:], decodedSecret[:32]) - - sharedSecret := curve25519.GenerateSharedSecret(*priv, pubKey) - - hash := sha256.New - - nullKey := make([]byte, 32) - h := hmac.New(hash, nullKey) - h.Write(sharedSecret) - - sharedSecretExtended, err := hkdf.Expand(h.Sum(nil), 80, "") - if err != nil { - return session, fmt.Errorf("hkdf error: %v", err) - } - - //login validation - checkSecret := make([]byte, 112) - copy(checkSecret[:32], decodedSecret[:32]) - copy(checkSecret[32:], decodedSecret[64:]) - h2 := hmac.New(hash, sharedSecretExtended[32:64]) - h2.Write(checkSecret) - if !hmac.Equal(h2.Sum(nil), decodedSecret[32:64]) { - return session, fmt.Errorf("abort login") - } - - keysEncrypted := make([]byte, 96) - copy(keysEncrypted[:16], sharedSecretExtended[64:]) - copy(keysEncrypted[16:], decodedSecret[64:]) - - keyDecrypted, err := cbc.Decrypt(sharedSecretExtended[:32], nil, keysEncrypted) - if err != nil { - return session, fmt.Errorf("error decryptAes: %v", err) - } - - session.EncKey = keyDecrypted[:32] - session.MacKey = keyDecrypted[32:64] - wac.session = &session - - return session, nil -} - -/* -RestoreSession is the function that restores a given session. It will try to reestablish the connection to the -WhatsAppWeb servers with the provided session. If it succeeds it will return a new session. This new session has to be -saved because the Client and Server-Token will change after every login. Logging in with old tokens is possible, but not -suggested. If so, a challenge has to be resolved which is just another possible point of failure. -*/ -func (wac *Conn) RestoreSession(session Session) (Session, error) { - if wac.session != nil && (wac.session.EncKey != nil || wac.session.MacKey != nil) { - return Session{}, fmt.Errorf("already logged in") - } - - wac.session = &session - - //listener for Conn or challenge; s1 is not allowed to drop - wac.listener["s1"] = make(chan string, 1) - - //admin init - init := []interface{}{"admin", "init", []int{0, 3, 225}, []string{wac.longClientName, wac.shortClientName}, session.ClientId, true} - initChan, err := wac.write(init) - if err != nil { - wac.session = nil - return Session{}, fmt.Errorf("error writing admin init: %v\n", err) - } - - //admin login with takeover - login := []interface{}{"admin", "login", session.ClientToken, session.ServerToken, session.ClientId, "takeover"} - loginChan, err := wac.write(login) - if err != nil { - wac.session = nil - return Session{}, fmt.Errorf("error writing admin login: %v\n", err) - } - - select { - case r := <-initChan: - var resp map[string]interface{} - if err = json.Unmarshal([]byte(r), &resp); err != nil { - wac.session = nil - return Session{}, fmt.Errorf("error decoding login connResp: %v\n", err) - } - - if int(resp["status"].(float64)) != 200 { - wac.session = nil - return Session{}, fmt.Errorf("init responded with %d", resp["status"]) - } - case <-time.After(wac.msgTimeout): - wac.session = nil - return Session{}, fmt.Errorf("restore session init timed out") - } - - //wait for s1 - var connResp []interface{} - select { - case r1 := <-wac.listener["s1"]: - if err := json.Unmarshal([]byte(r1), &connResp); err != nil { - wac.session = nil - return Session{}, fmt.Errorf("error decoding s1 message: %v\n", err) - } - case <-time.After(wac.msgTimeout): - wac.session = nil - return Session{}, fmt.Errorf("restore session connection timed out") - } - - //check if challenge is present - if len(connResp) == 2 && connResp[0] == "Cmd" && connResp[1].(map[string]interface{})["type"] == "challenge" { - wac.listener["s2"] = make(chan string, 1) - - if err := wac.resolveChallenge(connResp[1].(map[string]interface{})["challenge"].(string)); err != nil { - wac.session = nil - return Session{}, fmt.Errorf("error resolving challenge: %v\n", err) - } - - select { - case r := <-wac.listener["s2"]: - if err := json.Unmarshal([]byte(r), &connResp); err != nil { - wac.session = nil - return Session{}, fmt.Errorf("error decoding s2 message: %v\n", err) - } - case <-time.After(wac.msgTimeout): - wac.session = nil - return Session{}, fmt.Errorf("restore session challenge timed out") - } - } - - //check for login 200 --> login success - select { - case r := <-loginChan: - var resp map[string]interface{} - if err = json.Unmarshal([]byte(r), &resp); err != nil { - wac.session = nil - return Session{}, fmt.Errorf("error decoding login connResp: %v\n", err) - } - - if int(resp["status"].(float64)) != 200 { - wac.session = nil - return Session{}, fmt.Errorf("admin login responded with %d", resp["status"]) - } - case <-time.After(wac.msgTimeout): - wac.session = nil - return Session{}, fmt.Errorf("restore session login timed out") - } - - info := connResp[1].(map[string]interface{}) - - wac.Info = newInfoFromReq(info) - - //set new tokens - session.ClientToken = info["clientToken"].(string) - session.ServerToken = info["serverToken"].(string) - session.Wid = info["wid"].(string) - - return *wac.session, nil -} - -func (wac *Conn) resolveChallenge(challenge string) error { - decoded, err := base64.StdEncoding.DecodeString(challenge) - if err != nil { - return err - } - - h2 := hmac.New(sha256.New, wac.session.MacKey) - h2.Write([]byte(decoded)) - - ch := []interface{}{"admin", "challenge", base64.StdEncoding.EncodeToString(h2.Sum(nil)), wac.session.ServerToken, wac.session.ClientId} - challengeChan, err := wac.write(ch) - if err != nil { - return fmt.Errorf("error writing challenge: %v\n", err) - } - - select { - case r := <-challengeChan: - var resp map[string]interface{} - if err := json.Unmarshal([]byte(r), &resp); err != nil { - return fmt.Errorf("error decoding login resp: %v\n", err) - } - if int(resp["status"].(float64)) != 200 { - return fmt.Errorf("challenge responded with %d\n", resp["status"]) - } - case <-time.After(wac.msgTimeout): - return fmt.Errorf("connection timed out") - } - - return nil -} - -/* -Logout is the function to logout from a WhatsApp session. Logging out means invalidating the current session. -The session can not be resumed and will disappear on your phone in the WhatsAppWeb client list. -*/ -func (wac *Conn) Logout() error { - login := []interface{}{"admin", "Conn", "disconnect"} - _, err := wac.write(login) - if err != nil { - return fmt.Errorf("error writing logout: %v\n", err) - } - - return nil -} diff --git a/vendor/github.com/matterbridge/go-whatsapp/store.go b/vendor/github.com/matterbridge/go-whatsapp/store.go deleted file mode 100644 index 70b89efd..00000000 --- a/vendor/github.com/matterbridge/go-whatsapp/store.go +++ /dev/null @@ -1,45 +0,0 @@ -package whatsapp - -import ( - "github.com/matterbridge/go-whatsapp/binary" - "strings" -) - -type Store struct { - Contacts map[string]Contact -} - -type Contact struct { - Jid string - Notify string - Name string - Short string -} - -func newStore() *Store { - return &Store{ - make(map[string]Contact), - } -} - -func (wac *Conn) updateContacts(contacts interface{}) { - c, ok := contacts.([]interface{}) - if !ok { - return - } - - for _, contact := range c { - contactNode, ok := contact.(binary.Node) - if !ok { - continue - } - - jid := strings.Replace(contactNode.Attributes["jid"], "@c.us", "@s.whatsapp.net", 1) - wac.Store.Contacts[jid] = Contact{ - jid, - contactNode.Attributes["notify"], - contactNode.Attributes["name"], - contactNode.Attributes["short"], - } - } -} diff --git a/vendor/github.com/matterbridge/mautrix-whatsapp/LICENSE b/vendor/github.com/matterbridge/mautrix-whatsapp/LICENSE deleted file mode 100644 index be3f7b28..00000000 --- a/vendor/github.com/matterbridge/mautrix-whatsapp/LICENSE +++ /dev/null @@ -1,661 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/chat.go b/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/chat.go deleted file mode 100644 index b1a08823..00000000 --- a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/chat.go +++ /dev/null @@ -1,147 +0,0 @@ -// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. -// Copyright (C) 2019 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package whatsappExt - -import ( - "encoding/json" - "strings" - - "github.com/matterbridge/go-whatsapp" -) - -type ChatUpdateCommand string - -const ( - ChatUpdateCommandAction ChatUpdateCommand = "action" -) - -type ChatUpdate struct { - JID string `json:"id"` - Command ChatUpdateCommand `json:"cmd"` - Data ChatUpdateData `json:"data"` -} - -type ChatActionType string - -const ( - ChatActionNameChange ChatActionType = "subject" - ChatActionAddTopic ChatActionType = "desc_add" - ChatActionRemoveTopic ChatActionType = "desc_remove" - ChatActionRestrict ChatActionType = "restrict" - ChatActionAnnounce ChatActionType = "announce" - ChatActionPromote ChatActionType = "promote" - ChatActionDemote ChatActionType = "demote" -) - -type ChatUpdateData struct { - Action ChatActionType - SenderJID string - - NameChange struct { - Name string `json:"subject"` - SetAt int64 `json:"s_t"` - SetBy string `json:"s_o"` - } - - AddTopic struct { - Topic string `json:"desc"` - ID string `json:"descId"` - SetAt int64 `json:"descTime"` - } - - RemoveTopic struct { - ID string `json:"descId"` - } - - Restrict bool - - Announce bool - - PermissionChange struct { - JIDs []string `json:"participants"` - } -} - -func (cud *ChatUpdateData) UnmarshalJSON(data []byte) error { - var arr []json.RawMessage - err := json.Unmarshal(data, &arr) - if err != nil { - return err - } else if len(arr) < 3 { - return nil - } - - err = json.Unmarshal(arr[0], &cud.Action) - if err != nil { - return err - } - - err = json.Unmarshal(arr[1], &cud.SenderJID) - if err != nil { - return err - } - cud.SenderJID = strings.Replace(cud.SenderJID, OldUserSuffix, NewUserSuffix, 1) - - var unmarshalTo interface{} - switch cud.Action { - case ChatActionNameChange: - unmarshalTo = &cud.NameChange - case ChatActionAddTopic: - unmarshalTo = &cud.AddTopic - case ChatActionRemoveTopic: - unmarshalTo = &cud.RemoveTopic - case ChatActionRestrict: - unmarshalTo = &cud.Restrict - case ChatActionAnnounce: - unmarshalTo = &cud.Announce - case ChatActionPromote, ChatActionDemote: - unmarshalTo = &cud.PermissionChange - default: - return nil - } - err = json.Unmarshal(arr[2], unmarshalTo) - if err != nil { - return err - } - cud.NameChange.SetBy = strings.Replace(cud.NameChange.SetBy, OldUserSuffix, NewUserSuffix, 1) - for index, jid := range cud.PermissionChange.JIDs { - cud.PermissionChange.JIDs[index] = strings.Replace(jid, OldUserSuffix, NewUserSuffix, 1) - } - return nil -} - -type ChatUpdateHandler interface { - whatsapp.Handler - HandleChatUpdate(ChatUpdate) -} - -func (ext *ExtendedConn) handleMessageChatUpdate(message []byte) { - var event ChatUpdate - err := json.Unmarshal(message, &event) - if err != nil { - ext.jsonParseError(err) - return - } - event.JID = strings.Replace(event.JID, OldUserSuffix, NewUserSuffix, 1) - for _, handler := range ext.handlers { - chatUpdateHandler, ok := handler.(ChatUpdateHandler) - if !ok { - continue - } - go chatUpdateHandler.HandleChatUpdate(event) - } -} diff --git a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/cmd.go b/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/cmd.go deleted file mode 100644 index 69dbe60c..00000000 --- a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/cmd.go +++ /dev/null @@ -1,59 +0,0 @@ -// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. -// Copyright (C) 2019 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package whatsappExt - -import ( - "encoding/json" - "strings" - - "github.com/matterbridge/go-whatsapp" -) - -type CommandType string - -const ( - CommandPicture CommandType = "picture" -) - -type Command struct { - Type CommandType `json:"type"` - JID string `json:"jid"` - - *ProfilePicInfo -} - -type CommandHandler interface { - whatsapp.Handler - HandleCommand(Command) -} - -func (ext *ExtendedConn) handleMessageCommand(message []byte) { - var event Command - err := json.Unmarshal(message, &event) - if err != nil { - ext.jsonParseError(err) - return - } - event.JID = strings.Replace(event.JID, OldUserSuffix, NewUserSuffix, 1) - for _, handler := range ext.handlers { - commandHandler, ok := handler.(CommandHandler) - if !ok { - continue - } - go commandHandler.HandleCommand(event) - } -} diff --git a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/conn.go b/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/conn.go deleted file mode 100644 index 5084cb5a..00000000 --- a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/conn.go +++ /dev/null @@ -1,60 +0,0 @@ -// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. -// Copyright (C) 2019 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package whatsappExt - -import ( - "encoding/json" - - "github.com/matterbridge/go-whatsapp" -) - -type ConnInfo struct { - ProtocolVersion []int `json:"protoVersion"` - BinaryVersion int `json:"binVersion"` - Phone struct { - WhatsAppVersion string `json:"wa_version"` - MCC string `json:"mcc"` - MNC string `json:"mnc"` - OSVersion string `json:"os_version"` - DeviceManufacturer string `json:"device_manufacturer"` - DeviceModel string `json:"device_model"` - OSBuildNumber string `json:"os_build_number"` - } `json:"phone"` - Features map[string]interface{} `json:"features"` - PushName string `json:"pushname"` -} - -type ConnInfoHandler interface { - whatsapp.Handler - HandleConnInfo(ConnInfo) -} - -func (ext *ExtendedConn) handleMessageConn(message []byte) { - var event ConnInfo - err := json.Unmarshal(message, &event) - if err != nil { - ext.jsonParseError(err) - return - } - for _, handler := range ext.handlers { - connInfoHandler, ok := handler.(ConnInfoHandler) - if !ok { - continue - } - connInfoHandler.HandleConnInfo(event) - } -} diff --git a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/jsonmessage.go b/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/jsonmessage.go deleted file mode 100644 index 0b5a791c..00000000 --- a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/jsonmessage.go +++ /dev/null @@ -1,102 +0,0 @@ -// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. -// Copyright (C) 2019 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package whatsappExt - -import ( - "encoding/json" - - "github.com/matterbridge/go-whatsapp" -) - -type JSONMessage []json.RawMessage - -type JSONMessageType string - -const ( - MessageMsgInfo JSONMessageType = "MsgInfo" - MessageMsg JSONMessageType = "Msg" - MessagePresence JSONMessageType = "Presence" - MessageStream JSONMessageType = "Stream" - MessageConn JSONMessageType = "Conn" - MessageProps JSONMessageType = "Props" - MessageCmd JSONMessageType = "Cmd" - MessageChat JSONMessageType = "Chat" -) - -func (ext *ExtendedConn) AddHandler(handler whatsapp.Handler) { - ext.Conn.AddHandler(handler) - ext.handlers = append(ext.handlers, handler) -} - -func (ext *ExtendedConn) HandleError(error) {} - -type UnhandledJSONMessageHandler interface { - whatsapp.Handler - HandleUnhandledJSONMessage(string) -} - -type JSONParseErrorHandler interface { - whatsapp.Handler - HandleJSONParseError(error) -} - -func (ext *ExtendedConn) jsonParseError(err error) { - for _, handler := range ext.handlers { - errorHandler, ok := handler.(JSONParseErrorHandler) - if !ok { - continue - } - errorHandler.HandleJSONParseError(err) - } -} - -func (ext *ExtendedConn) HandleJsonMessage(message string) { - msg := JSONMessage{} - err := json.Unmarshal([]byte(message), &msg) - if err != nil || len(msg) < 2 { - ext.jsonParseError(err) - return - } - - var msgType JSONMessageType - json.Unmarshal(msg[0], &msgType) - - switch msgType { - case MessagePresence: - ext.handleMessagePresence(msg[1]) - case MessageStream: - ext.handleMessageStream(msg[1:]) - case MessageConn: - ext.handleMessageConn(msg[1]) - case MessageProps: - ext.handleMessageProps(msg[1]) - case MessageMsgInfo, MessageMsg: - ext.handleMessageMsgInfo(msgType, msg[1]) - case MessageCmd: - ext.handleMessageCommand(msg[1]) - case MessageChat: - ext.handleMessageChatUpdate(msg[1]) - default: - for _, handler := range ext.handlers { - ujmHandler, ok := handler.(UnhandledJSONMessageHandler) - if !ok { - continue - } - ujmHandler.HandleUnhandledJSONMessage(message) - } - } -} diff --git a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/msginfo.go b/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/msginfo.go deleted file mode 100644 index e929ec90..00000000 --- a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/msginfo.go +++ /dev/null @@ -1,90 +0,0 @@ -// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. -// Copyright (C) 2019 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package whatsappExt - -import ( - "encoding/json" - "strings" - - "github.com/matterbridge/go-whatsapp" -) - -type MsgInfoCommand string - -const ( - MsgInfoCommandAck MsgInfoCommand = "ack" - MsgInfoCommandAcks MsgInfoCommand = "acks" -) - -type Acknowledgement int - -const ( - AckMessageSent Acknowledgement = 1 - AckMessageDelivered Acknowledgement = 2 - AckMessageRead Acknowledgement = 3 -) - -type JSONStringOrArray []string - -func (jsoa *JSONStringOrArray) UnmarshalJSON(data []byte) error { - var str string - if json.Unmarshal(data, &str) == nil { - *jsoa = []string{str} - return nil - } - var strs []string - json.Unmarshal(data, &strs) - *jsoa = strs - return nil -} - -type MsgInfo struct { - Command MsgInfoCommand `json:"cmd"` - IDs JSONStringOrArray `json:"id"` - Acknowledgement Acknowledgement `json:"ack"` - MessageFromJID string `json:"from"` - SenderJID string `json:"participant"` - ToJID string `json:"to"` - Timestamp int64 `json:"t"` -} - -type MsgInfoHandler interface { - whatsapp.Handler - HandleMsgInfo(MsgInfo) -} - -func (ext *ExtendedConn) handleMessageMsgInfo(msgType JSONMessageType, message []byte) { - var event MsgInfo - err := json.Unmarshal(message, &event) - if err != nil { - ext.jsonParseError(err) - return - } - event.MessageFromJID = strings.Replace(event.MessageFromJID, OldUserSuffix, NewUserSuffix, 1) - event.SenderJID = strings.Replace(event.SenderJID, OldUserSuffix, NewUserSuffix, 1) - event.ToJID = strings.Replace(event.ToJID, OldUserSuffix, NewUserSuffix, 1) - if msgType == MessageMsg { - event.SenderJID = event.ToJID - } - for _, handler := range ext.handlers { - msgInfoHandler, ok := handler.(MsgInfoHandler) - if !ok { - continue - } - go msgInfoHandler.HandleMsgInfo(event) - } -} diff --git a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/presence.go b/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/presence.go deleted file mode 100644 index d70a753a..00000000 --- a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/presence.go +++ /dev/null @@ -1,67 +0,0 @@ -// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. -// Copyright (C) 2019 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package whatsappExt - -import ( - "encoding/json" - "strings" - - "github.com/matterbridge/go-whatsapp" -) - -type PresenceType string - -const ( - PresenceUnavailable PresenceType = "unavailable" - PresenceAvailable PresenceType = "available" - PresenceComposing PresenceType = "composing" -) - -type Presence struct { - JID string `json:"id"` - SenderJID string `json:"participant"` - Status PresenceType `json:"type"` - Timestamp int64 `json:"t"` - Deny bool `json:"deny"` -} - -type PresenceHandler interface { - whatsapp.Handler - HandlePresence(Presence) -} - -func (ext *ExtendedConn) handleMessagePresence(message []byte) { - var event Presence - err := json.Unmarshal(message, &event) - if err != nil { - ext.jsonParseError(err) - return - } - event.JID = strings.Replace(event.JID, OldUserSuffix, NewUserSuffix, 1) - if len(event.SenderJID) == 0 { - event.SenderJID = event.JID - } else { - event.SenderJID = strings.Replace(event.SenderJID, OldUserSuffix, NewUserSuffix, 1) - } - for _, handler := range ext.handlers { - presenceHandler, ok := handler.(PresenceHandler) - if !ok { - continue - } - go presenceHandler.HandlePresence(event) - } -} diff --git a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/props.go b/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/props.go deleted file mode 100644 index dcfdef9e..00000000 --- a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/props.go +++ /dev/null @@ -1,68 +0,0 @@ -// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. -// Copyright (C) 2019 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package whatsappExt - -import ( - "encoding/json" - - "github.com/matterbridge/go-whatsapp" -) - -type ProtocolProps struct { - WebPresence bool `json:"webPresence"` - NotificationQuery bool `json:"notificationQuery"` - FacebookCrashLog bool `json:"fbCrashlog"` - Bucket string `json:"bucket"` - GIFSearch string `json:"gifSearch"` - Spam bool `json:"SPAM"` - SetBlock bool `json:"SET_BLOCK"` - MessageInfo bool `json:"MESSAGE_INFO"` - MaxFileSize int `json:"maxFileSize"` - Media int `json:"media"` - GroupNameLength int `json:"maxSubject"` - GroupDescriptionLength int `json:"groupDescLength"` - MaxParticipants int `json:"maxParticipants"` - VideoMaxEdge int `json:"videoMaxEdge"` - ImageMaxEdge int `json:"imageMaxEdge"` - ImageMaxKilobytes int `json:"imageMaxKBytes"` - Edit int `json:"edit"` - FwdUIStartTimestamp int `json:"fwdUiStartTs"` - GroupsV3 int `json:"groupsV3"` - RestrictGroups int `json:"restrictGroups"` - AnnounceGroups int `json:"announceGroups"` -} - -type ProtocolPropsHandler interface { - whatsapp.Handler - HandleProtocolProps(ProtocolProps) -} - -func (ext *ExtendedConn) handleMessageProps(message []byte) { - var event ProtocolProps - err := json.Unmarshal(message, &event) - if err != nil { - ext.jsonParseError(err) - return - } - for _, handler := range ext.handlers { - protocolPropsHandler, ok := handler.(ProtocolPropsHandler) - if !ok { - continue - } - go protocolPropsHandler.HandleProtocolProps(event) - } -} diff --git a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/stream.go b/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/stream.go deleted file mode 100644 index f2b222d5..00000000 --- a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/stream.go +++ /dev/null @@ -1,63 +0,0 @@ -// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. -// Copyright (C) 2019 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package whatsappExt - -import ( - "encoding/json" - - "github.com/matterbridge/go-whatsapp" -) - -type StreamType string - -const ( - StreamUpdate = "update" - StreamSleep = "asleep" -) - -type StreamEvent struct { - Type StreamType - Boolean bool - Version string -} - -type StreamEventHandler interface { - whatsapp.Handler - HandleStreamEvent(StreamEvent) -} - -func (ext *ExtendedConn) handleMessageStream(message []json.RawMessage) { - var event StreamEvent - err := json.Unmarshal(message[0], &event.Type) - if err != nil { - ext.jsonParseError(err) - return - } - - if event.Type == StreamUpdate && len(message) > 4 { - json.Unmarshal(message[1], event.Boolean) - json.Unmarshal(message[2], event.Version) - } - - for _, handler := range ext.handlers { - streamHandler, ok := handler.(StreamEventHandler) - if !ok { - continue - } - go streamHandler.HandleStreamEvent(event) - } -} diff --git a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/whatsapp.go b/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/whatsapp.go deleted file mode 100644 index bd28a06d..00000000 --- a/vendor/github.com/matterbridge/mautrix-whatsapp/whatsapp-ext/whatsapp.go +++ /dev/null @@ -1,132 +0,0 @@ -// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. -// Copyright (C) 2019 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package whatsappExt - -import ( - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "strings" - - "github.com/matterbridge/go-whatsapp" -) - -const ( - OldUserSuffix = "@c.us" - NewUserSuffix = "@s.whatsapp.net" -) - -type ExtendedConn struct { - *whatsapp.Conn - - handlers []whatsapp.Handler -} - -func ExtendConn(conn *whatsapp.Conn) *ExtendedConn { - ext := &ExtendedConn{ - Conn: conn, - } - ext.Conn.AddHandler(ext) - return ext -} - -type GroupInfo struct { - JID string `json:"jid"` - OwnerJID string `json:"owner"` - - Name string `json:"subject"` - NameSetTime int64 `json:"subjectTime"` - NameSetBy string `json:"subjectOwner"` - - Topic string `json:"desc"` - TopicID string `json:"descId"` - TopicSetAt int64 `json:"descTime"` - TopicSetBy string `json:"descOwner"` - - GroupCreated int64 `json:"creation"` - - Status int16 `json:"status"` - - Participants []struct { - JID string `json:"id"` - IsAdmin bool `json:"isAdmin"` - IsSuperAdmin bool `json:"isSuperAdmin"` - } `json:"participants"` -} - -func (ext *ExtendedConn) GetGroupMetaData(jid string) (*GroupInfo, error) { - data, err := ext.Conn.GetGroupMetaData(jid) - if err != nil { - return nil, fmt.Errorf("failed to get group metadata: %v", err) - } - content := <-data - - info := &GroupInfo{} - err = json.Unmarshal([]byte(content), info) - if err != nil { - return info, fmt.Errorf("failed to unmarshal group metadata: %v", err) - } - - for index, participant := range info.Participants { - info.Participants[index].JID = strings.Replace(participant.JID, OldUserSuffix, NewUserSuffix, 1) - } - info.NameSetBy = strings.Replace(info.NameSetBy, OldUserSuffix, NewUserSuffix, 1) - info.TopicSetBy = strings.Replace(info.TopicSetBy, OldUserSuffix, NewUserSuffix, 1) - - return info, nil -} - -type ProfilePicInfo struct { - URL string `json:"eurl"` - Tag string `json:"tag"` - - Status int16 `json:"status"` -} - -func (ppi *ProfilePicInfo) Download() (io.ReadCloser, error) { - resp, err := http.Get(ppi.URL) - if err != nil { - return nil, err - } - return resp.Body, nil -} - -func (ppi *ProfilePicInfo) DownloadBytes() ([]byte, error) { - body, err := ppi.Download() - if err != nil { - return nil, err - } - defer body.Close() - data, err := ioutil.ReadAll(body) - return data, err -} - -func (ext *ExtendedConn) GetProfilePicThumb(jid string) (*ProfilePicInfo, error) { - data, err := ext.Conn.GetProfilePicThumb(jid) - if err != nil { - return nil, fmt.Errorf("failed to get avatar: %v", err) - } - content := <-data - info := &ProfilePicInfo{} - err = json.Unmarshal([]byte(content), info) - if err != nil { - return info, fmt.Errorf("failed to unmarshal avatar info: %v", err) - } - return info, nil -} diff --git a/vendor/github.com/pkg/errors/.travis.yml b/vendor/github.com/pkg/errors/.travis.yml index 588ceca1..d4b92663 100644 --- a/vendor/github.com/pkg/errors/.travis.yml +++ b/vendor/github.com/pkg/errors/.travis.yml @@ -1,10 +1,14 @@ language: go go_import_path: github.com/pkg/errors go: - - 1.4.3 - - 1.5.4 - - 1.6.2 - - 1.7.1 + - 1.4.x + - 1.5.x + - 1.6.x + - 1.7.x + - 1.8.x + - 1.9.x + - 1.10.x + - 1.11.x - tip script: diff --git a/vendor/github.com/pkg/errors/README.md b/vendor/github.com/pkg/errors/README.md index 273db3c9..6483ba2a 100644 --- a/vendor/github.com/pkg/errors/README.md +++ b/vendor/github.com/pkg/errors/README.md @@ -1,4 +1,4 @@ -# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) +# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) [![Sourcegraph](https://sourcegraph.com/github.com/pkg/errors/-/badge.svg)](https://sourcegraph.com/github.com/pkg/errors?badge) Package errors provides simple error handling primitives. @@ -47,6 +47,6 @@ We welcome pull requests, bug fixes and issue reports. With that said, the bar f Before proposing a change, please discuss your change by raising an issue. -## Licence +## License BSD-2-Clause diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go index 842ee804..7421f326 100644 --- a/vendor/github.com/pkg/errors/errors.go +++ b/vendor/github.com/pkg/errors/errors.go @@ -6,7 +6,7 @@ // return err // } // -// which applied recursively up the call stack results in error reports +// which when applied recursively up the call stack results in error reports // without context or debugging information. The errors package allows // programmers to add context to the failure path in their code in a way // that does not destroy the original value of the error. @@ -15,16 +15,17 @@ // // The errors.Wrap function returns a new error that adds context to the // original error by recording a stack trace at the point Wrap is called, -// and the supplied message. For example +// together with the supplied message. For example // // _, err := ioutil.ReadAll(r) // if err != nil { // return errors.Wrap(err, "read failed") // } // -// If additional control is required the errors.WithStack and errors.WithMessage -// functions destructure errors.Wrap into its component operations of annotating -// an error with a stack trace and an a message, respectively. +// If additional control is required, the errors.WithStack and +// errors.WithMessage functions destructure errors.Wrap into its component +// operations: annotating an error with a stack trace and with a message, +// respectively. // // Retrieving the cause of an error // @@ -38,7 +39,7 @@ // } // // can be inspected by errors.Cause. errors.Cause will recursively retrieve -// the topmost error which does not implement causer, which is assumed to be +// the topmost error that does not implement causer, which is assumed to be // the original cause. For example: // // switch err := errors.Cause(err).(type) { @@ -48,16 +49,16 @@ // // unknown error // } // -// causer interface is not exported by this package, but is considered a part -// of stable public API. +// Although the causer interface is not exported by this package, it is +// considered a part of its stable public interface. // // Formatted printing of errors // // All error values returned from this package implement fmt.Formatter and can -// be formatted by the fmt package. The following verbs are supported +// be formatted by the fmt package. The following verbs are supported: // // %s print the error. If the error has a Cause it will be -// printed recursively +// printed recursively. // %v see %s // %+v extended format. Each Frame of the error's StackTrace will // be printed in detail. @@ -65,13 +66,13 @@ // Retrieving the stack trace of an error or wrapper // // New, Errorf, Wrap, and Wrapf record a stack trace at the point they are -// invoked. This information can be retrieved with the following interface. +// invoked. This information can be retrieved with the following interface: // // type stackTracer interface { // StackTrace() errors.StackTrace // } // -// Where errors.StackTrace is defined as +// The returned errors.StackTrace type is defined as // // type StackTrace []Frame // @@ -85,8 +86,8 @@ // } // } // -// stackTracer interface is not exported by this package, but is considered a part -// of stable public API. +// Although the stackTracer interface is not exported by this package, it is +// considered a part of its stable public interface. // // See the documentation for Frame.Format for more details. package errors @@ -192,7 +193,7 @@ func Wrap(err error, message string) error { } // Wrapf returns an error annotating err with a stack trace -// at the point Wrapf is call, and the format specifier. +// at the point Wrapf is called, and the format specifier. // If err is nil, Wrapf returns nil. func Wrapf(err error, format string, args ...interface{}) error { if err == nil { @@ -220,6 +221,18 @@ func WithMessage(err error, message string) error { } } +// WithMessagef annotates err with the format specifier. +// If err is nil, WithMessagef returns nil. +func WithMessagef(err error, format string, args ...interface{}) error { + if err == nil { + return nil + } + return &withMessage{ + cause: err, + msg: fmt.Sprintf(format, args...), + } +} + type withMessage struct { cause error msg string diff --git a/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/pkg/errors/stack.go index 6b1f2891..2874a048 100644 --- a/vendor/github.com/pkg/errors/stack.go +++ b/vendor/github.com/pkg/errors/stack.go @@ -46,7 +46,8 @@ func (f Frame) line() int { // // Format accepts flags that alter the printing of some verbs, as follows: // -// %+s path of source file relative to the compile time GOPATH +// %+s function name and path of source file relative to the compile time +// GOPATH separated by \n\t (\n\t) // %+v equivalent to %+s:%d func (f Frame) Format(s fmt.State, verb rune) { switch verb { @@ -79,6 +80,14 @@ func (f Frame) Format(s fmt.State, verb rune) { // StackTrace is stack of Frames from innermost (newest) to outermost (oldest). type StackTrace []Frame +// Format formats the stack of Frames according to the fmt.Formatter interface. +// +// %s lists source files for each Frame in the stack +// %v lists the source file and line number for each Frame in the stack +// +// Format accepts flags that alter the printing of some verbs, as follows: +// +// %+v Prints filename, function, and line number for each Frame in the stack. func (st StackTrace) Format(s fmt.State, verb rune) { switch verb { case 'v': @@ -136,43 +145,3 @@ func funcname(name string) string { i = strings.Index(name, ".") return name[i+1:] } - -func trimGOPATH(name, file string) string { - // Here we want to get the source file path relative to the compile time - // GOPATH. As of Go 1.6.x there is no direct way to know the compiled - // GOPATH at runtime, but we can infer the number of path segments in the - // GOPATH. We note that fn.Name() returns the function name qualified by - // the import path, which does not include the GOPATH. Thus we can trim - // segments from the beginning of the file path until the number of path - // separators remaining is one more than the number of path separators in - // the function name. For example, given: - // - // GOPATH /home/user - // file /home/user/src/pkg/sub/file.go - // fn.Name() pkg/sub.Type.Method - // - // We want to produce: - // - // pkg/sub/file.go - // - // From this we can easily see that fn.Name() has one less path separator - // than our desired output. We count separators from the end of the file - // path until it finds two more than in the function name and then move - // one character forward to preserve the initial path segment without a - // leading separator. - const sep = "/" - goal := strings.Count(name, sep) + 2 - i := len(file) - for n := 0; n < goal; n++ { - i = strings.LastIndex(file[:i], sep) - if i == -1 { - // not enough separators found, set i so that the slice expression - // below leaves file unmodified - i = -len(sep) - break - } - } - // get back to 0 or trim the leading separator - file = file[i+len(sep):] - return file -} diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go index 0c1c671c..aad645b4 100644 --- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go +++ b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go @@ -6,14 +6,13 @@ package chacha20 -var haveAsm = hasVectorFacility() +import ( + "golang.org/x/sys/cpu" +) -const bufSize = 256 +var haveAsm = cpu.S390X.HasVX -// hasVectorFacility reports whether the machine supports the vector -// facility (vx). -// Implementation in asm_s390x.s. -func hasVectorFacility() bool +const bufSize = 256 // xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only // be called when the vector facility is available. diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s index 98427c5e..57df4044 100644 --- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s +++ b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s @@ -258,26 +258,3 @@ tail: MOVD R8, R3 MOVD $0, R4 JMP continue - -// func hasVectorFacility() bool -TEXT ·hasVectorFacility(SB), NOSPLIT, $24-1 - MOVD $x-24(SP), R1 - XC $24, 0(R1), 0(R1) // clear the storage - MOVD $2, R0 // R0 is the number of double words stored -1 - WORD $0xB2B01000 // STFLE 0(R1) - XOR R0, R0 // reset the value of R0 - MOVBZ z-8(SP), R1 - AND $0x40, R1 - BEQ novector - -vectorinstalled: - // check if the vector instruction has been enabled - VLEIB $0, $0xF, V16 - VLGVB $0, V16, R1 - CMPBNE R1, $0xF, novector - MOVB $1, ret+0(FP) // have vx - RET - -novector: - MOVB $0, ret+0(FP) // no vx - RET diff --git a/vendor/golang.org/x/crypto/poly1305/mac_noasm.go b/vendor/golang.org/x/crypto/poly1305/mac_noasm.go new file mode 100644 index 00000000..8387d299 --- /dev/null +++ b/vendor/golang.org/x/crypto/poly1305/mac_noasm.go @@ -0,0 +1,11 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !amd64 gccgo appengine + +package poly1305 + +type mac struct{ macGeneric } + +func newMAC(key *[32]byte) mac { return mac{newMACGeneric(key)} } diff --git a/vendor/golang.org/x/crypto/poly1305/poly1305.go b/vendor/golang.org/x/crypto/poly1305/poly1305.go index f562fa57..d076a562 100644 --- a/vendor/golang.org/x/crypto/poly1305/poly1305.go +++ b/vendor/golang.org/x/crypto/poly1305/poly1305.go @@ -2,21 +2,19 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -/* -Package poly1305 implements Poly1305 one-time message authentication code as -specified in https://cr.yp.to/mac/poly1305-20050329.pdf. - -Poly1305 is a fast, one-time authentication function. It is infeasible for an -attacker to generate an authenticator for a message without the key. However, a -key must only be used for a single message. Authenticating two different -messages with the same key allows an attacker to forge authenticators for other -messages with the same key. - -Poly1305 was originally coupled with AES in order to make Poly1305-AES. AES was -used with a fixed key in order to generate one-time keys from an nonce. -However, in this package AES isn't used and the one-time key is specified -directly. -*/ +// Package poly1305 implements Poly1305 one-time message authentication code as +// specified in https://cr.yp.to/mac/poly1305-20050329.pdf. +// +// Poly1305 is a fast, one-time authentication function. It is infeasible for an +// attacker to generate an authenticator for a message without the key. However, a +// key must only be used for a single message. Authenticating two different +// messages with the same key allows an attacker to forge authenticators for other +// messages with the same key. +// +// Poly1305 was originally coupled with AES in order to make Poly1305-AES. AES was +// used with a fixed key in order to generate one-time keys from an nonce. +// However, in this package AES isn't used and the one-time key is specified +// directly. package poly1305 // import "golang.org/x/crypto/poly1305" import "crypto/subtle" @@ -31,3 +29,55 @@ func Verify(mac *[16]byte, m []byte, key *[32]byte) bool { Sum(&tmp, m, key) return subtle.ConstantTimeCompare(tmp[:], mac[:]) == 1 } + +// New returns a new MAC computing an authentication +// tag of all data written to it with the given key. +// This allows writing the message progressively instead +// of passing it as a single slice. Common users should use +// the Sum function instead. +// +// The key must be unique for each message, as authenticating +// two different messages with the same key allows an attacker +// to forge messages at will. +func New(key *[32]byte) *MAC { + return &MAC{ + mac: newMAC(key), + finalized: false, + } +} + +// MAC is an io.Writer computing an authentication tag +// of the data written to it. +// +// MAC cannot be used like common hash.Hash implementations, +// because using a poly1305 key twice breaks its security. +// Therefore writing data to a running MAC after calling +// Sum causes it to panic. +type MAC struct { + mac // platform-dependent implementation + + finalized bool +} + +// Size returns the number of bytes Sum will return. +func (h *MAC) Size() int { return TagSize } + +// Write adds more data to the running message authentication code. +// It never returns an error. +// +// It must not be called after the first call of Sum. +func (h *MAC) Write(p []byte) (n int, err error) { + if h.finalized { + panic("poly1305: write to MAC after Sum") + } + return h.mac.Write(p) +} + +// Sum computes the authenticator of all data written to the +// message authentication code. +func (h *MAC) Sum(b []byte) []byte { + var mac [TagSize]byte + h.mac.Sum(&mac) + h.finalized = true + return append(b, mac[:]...) +} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_amd64.go b/vendor/golang.org/x/crypto/poly1305/sum_amd64.go index 4dd72fe7..2dbf42aa 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_amd64.go +++ b/vendor/golang.org/x/crypto/poly1305/sum_amd64.go @@ -6,17 +6,63 @@ package poly1305 -// This function is implemented in sum_amd64.s //go:noescape -func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]byte) +func initialize(state *[7]uint64, key *[32]byte) + +//go:noescape +func update(state *[7]uint64, msg []byte) + +//go:noescape +func finalize(tag *[TagSize]byte, state *[7]uint64) // Sum generates an authenticator for m using a one-time key and puts the // 16-byte result into out. Authenticating two different messages with the same // key allows an attacker to forge messages at will. func Sum(out *[16]byte, m []byte, key *[32]byte) { - var mPtr *byte - if len(m) > 0 { - mPtr = &m[0] + h := newMAC(key) + h.Write(m) + h.Sum(out) +} + +func newMAC(key *[32]byte) (h mac) { + initialize(&h.state, key) + return +} + +type mac struct { + state [7]uint64 // := uint64{ h0, h1, h2, r0, r1, pad0, pad1 } + + buffer [TagSize]byte + offset int +} + +func (h *mac) Write(p []byte) (n int, err error) { + n = len(p) + if h.offset > 0 { + remaining := TagSize - h.offset + if n < remaining { + h.offset += copy(h.buffer[h.offset:], p) + return n, nil + } + copy(h.buffer[h.offset:], p[:remaining]) + p = p[remaining:] + h.offset = 0 + update(&h.state, h.buffer[:]) + } + if nn := len(p) - (len(p) % TagSize); nn > 0 { + update(&h.state, p[:nn]) + p = p[nn:] + } + if len(p) > 0 { + h.offset += copy(h.buffer[h.offset:], p) + } + return n, nil +} + +func (h *mac) Sum(out *[16]byte) { + state := h.state + if h.offset > 0 { + update(&state, h.buffer[:h.offset]) } - poly1305(out, mPtr, uint64(len(m)), key) + finalize(out, &state) } diff --git a/vendor/golang.org/x/crypto/poly1305/sum_amd64.s b/vendor/golang.org/x/crypto/poly1305/sum_amd64.s index 2edae638..7d600f13 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_amd64.s +++ b/vendor/golang.org/x/crypto/poly1305/sum_amd64.s @@ -58,20 +58,17 @@ DATA ·poly1305Mask<>+0x00(SB)/8, $0x0FFFFFFC0FFFFFFF DATA ·poly1305Mask<>+0x08(SB)/8, $0x0FFFFFFC0FFFFFFC GLOBL ·poly1305Mask<>(SB), RODATA, $16 -// func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]key) -TEXT ·poly1305(SB), $0-32 - MOVQ out+0(FP), DI - MOVQ m+8(FP), SI - MOVQ mlen+16(FP), R15 - MOVQ key+24(FP), AX - - MOVQ 0(AX), R11 - MOVQ 8(AX), R12 - ANDQ ·poly1305Mask<>(SB), R11 // r0 - ANDQ ·poly1305Mask<>+8(SB), R12 // r1 - XORQ R8, R8 // h0 - XORQ R9, R9 // h1 - XORQ R10, R10 // h2 +// func update(state *[7]uint64, msg []byte) +TEXT ·update(SB), $0-32 + MOVQ state+0(FP), DI + MOVQ msg_base+8(FP), SI + MOVQ msg_len+16(FP), R15 + + MOVQ 0(DI), R8 // h0 + MOVQ 8(DI), R9 // h1 + MOVQ 16(DI), R10 // h2 + MOVQ 24(DI), R11 // r0 + MOVQ 32(DI), R12 // r1 CMPQ R15, $16 JB bytes_between_0_and_15 @@ -109,16 +106,42 @@ flush_buffer: JMP multiply done: - MOVQ R8, AX - MOVQ R9, BX + MOVQ R8, 0(DI) + MOVQ R9, 8(DI) + MOVQ R10, 16(DI) + RET + +// func initialize(state *[7]uint64, key *[32]byte) +TEXT ·initialize(SB), $0-16 + MOVQ state+0(FP), DI + MOVQ key+8(FP), SI + + // state[0...7] is initialized with zero + MOVOU 0(SI), X0 + MOVOU 16(SI), X1 + MOVOU ·poly1305Mask<>(SB), X2 + PAND X2, X0 + MOVOU X0, 24(DI) + MOVOU X1, 40(DI) + RET + +// func finalize(tag *[TagSize]byte, state *[7]uint64) +TEXT ·finalize(SB), $0-16 + MOVQ tag+0(FP), DI + MOVQ state+8(FP), SI + + MOVQ 0(SI), AX + MOVQ 8(SI), BX + MOVQ 16(SI), CX + MOVQ AX, R8 + MOVQ BX, R9 SUBQ $0xFFFFFFFFFFFFFFFB, AX SBBQ $0xFFFFFFFFFFFFFFFF, BX - SBBQ $3, R10 + SBBQ $3, CX CMOVQCS R8, AX CMOVQCS R9, BX - MOVQ key+24(FP), R8 - ADDQ 16(R8), AX - ADCQ 24(R8), BX + ADDQ 40(SI), AX + ADCQ 48(SI), BX MOVQ AX, 0(DI) MOVQ BX, 8(DI) diff --git a/vendor/golang.org/x/crypto/poly1305/sum_generic.go b/vendor/golang.org/x/crypto/poly1305/sum_generic.go new file mode 100644 index 00000000..bab76ef0 --- /dev/null +++ b/vendor/golang.org/x/crypto/poly1305/sum_generic.go @@ -0,0 +1,172 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package poly1305 + +import "encoding/binary" + +const ( + msgBlock = uint32(1 << 24) + finalBlock = uint32(0) +) + +// sumGeneric generates an authenticator for msg using a one-time key and +// puts the 16-byte result into out. This is the generic implementation of +// Sum and should be called if no assembly implementation is available. +func sumGeneric(out *[TagSize]byte, msg []byte, key *[32]byte) { + h := newMACGeneric(key) + h.Write(msg) + h.Sum(out) +} + +func newMACGeneric(key *[32]byte) (h macGeneric) { + h.r[0] = binary.LittleEndian.Uint32(key[0:]) & 0x3ffffff + h.r[1] = (binary.LittleEndian.Uint32(key[3:]) >> 2) & 0x3ffff03 + h.r[2] = (binary.LittleEndian.Uint32(key[6:]) >> 4) & 0x3ffc0ff + h.r[3] = (binary.LittleEndian.Uint32(key[9:]) >> 6) & 0x3f03fff + h.r[4] = (binary.LittleEndian.Uint32(key[12:]) >> 8) & 0x00fffff + + h.s[0] = binary.LittleEndian.Uint32(key[16:]) + h.s[1] = binary.LittleEndian.Uint32(key[20:]) + h.s[2] = binary.LittleEndian.Uint32(key[24:]) + h.s[3] = binary.LittleEndian.Uint32(key[28:]) + return +} + +type macGeneric struct { + h, r [5]uint32 + s [4]uint32 + + buffer [TagSize]byte + offset int +} + +func (h *macGeneric) Write(p []byte) (n int, err error) { + n = len(p) + if h.offset > 0 { + remaining := TagSize - h.offset + if n < remaining { + h.offset += copy(h.buffer[h.offset:], p) + return n, nil + } + copy(h.buffer[h.offset:], p[:remaining]) + p = p[remaining:] + h.offset = 0 + updateGeneric(h.buffer[:], msgBlock, &(h.h), &(h.r)) + } + if nn := len(p) - (len(p) % TagSize); nn > 0 { + updateGeneric(p, msgBlock, &(h.h), &(h.r)) + p = p[nn:] + } + if len(p) > 0 { + h.offset += copy(h.buffer[h.offset:], p) + } + return n, nil +} + +func (h *macGeneric) Sum(out *[16]byte) { + H, R := h.h, h.r + if h.offset > 0 { + var buffer [TagSize]byte + copy(buffer[:], h.buffer[:h.offset]) + buffer[h.offset] = 1 // invariant: h.offset < TagSize + updateGeneric(buffer[:], finalBlock, &H, &R) + } + finalizeGeneric(out, &H, &(h.s)) +} + +func updateGeneric(msg []byte, flag uint32, h, r *[5]uint32) { + h0, h1, h2, h3, h4 := h[0], h[1], h[2], h[3], h[4] + r0, r1, r2, r3, r4 := uint64(r[0]), uint64(r[1]), uint64(r[2]), uint64(r[3]), uint64(r[4]) + R1, R2, R3, R4 := r1*5, r2*5, r3*5, r4*5 + + for len(msg) >= TagSize { + // h += msg + h0 += binary.LittleEndian.Uint32(msg[0:]) & 0x3ffffff + h1 += (binary.LittleEndian.Uint32(msg[3:]) >> 2) & 0x3ffffff + h2 += (binary.LittleEndian.Uint32(msg[6:]) >> 4) & 0x3ffffff + h3 += (binary.LittleEndian.Uint32(msg[9:]) >> 6) & 0x3ffffff + h4 += (binary.LittleEndian.Uint32(msg[12:]) >> 8) | flag + + // h *= r + d0 := (uint64(h0) * r0) + (uint64(h1) * R4) + (uint64(h2) * R3) + (uint64(h3) * R2) + (uint64(h4) * R1) + d1 := (d0 >> 26) + (uint64(h0) * r1) + (uint64(h1) * r0) + (uint64(h2) * R4) + (uint64(h3) * R3) + (uint64(h4) * R2) + d2 := (d1 >> 26) + (uint64(h0) * r2) + (uint64(h1) * r1) + (uint64(h2) * r0) + (uint64(h3) * R4) + (uint64(h4) * R3) + d3 := (d2 >> 26) + (uint64(h0) * r3) + (uint64(h1) * r2) + (uint64(h2) * r1) + (uint64(h3) * r0) + (uint64(h4) * R4) + d4 := (d3 >> 26) + (uint64(h0) * r4) + (uint64(h1) * r3) + (uint64(h2) * r2) + (uint64(h3) * r1) + (uint64(h4) * r0) + + // h %= p + h0 = uint32(d0) & 0x3ffffff + h1 = uint32(d1) & 0x3ffffff + h2 = uint32(d2) & 0x3ffffff + h3 = uint32(d3) & 0x3ffffff + h4 = uint32(d4) & 0x3ffffff + + h0 += uint32(d4>>26) * 5 + h1 += h0 >> 26 + h0 = h0 & 0x3ffffff + + msg = msg[TagSize:] + } + + h[0], h[1], h[2], h[3], h[4] = h0, h1, h2, h3, h4 +} + +func finalizeGeneric(out *[TagSize]byte, h *[5]uint32, s *[4]uint32) { + h0, h1, h2, h3, h4 := h[0], h[1], h[2], h[3], h[4] + + // h %= p reduction + h2 += h1 >> 26 + h1 &= 0x3ffffff + h3 += h2 >> 26 + h2 &= 0x3ffffff + h4 += h3 >> 26 + h3 &= 0x3ffffff + h0 += 5 * (h4 >> 26) + h4 &= 0x3ffffff + h1 += h0 >> 26 + h0 &= 0x3ffffff + + // h - p + t0 := h0 + 5 + t1 := h1 + (t0 >> 26) + t2 := h2 + (t1 >> 26) + t3 := h3 + (t2 >> 26) + t4 := h4 + (t3 >> 26) - (1 << 26) + t0 &= 0x3ffffff + t1 &= 0x3ffffff + t2 &= 0x3ffffff + t3 &= 0x3ffffff + + // select h if h < p else h - p + t_mask := (t4 >> 31) - 1 + h_mask := ^t_mask + h0 = (h0 & h_mask) | (t0 & t_mask) + h1 = (h1 & h_mask) | (t1 & t_mask) + h2 = (h2 & h_mask) | (t2 & t_mask) + h3 = (h3 & h_mask) | (t3 & t_mask) + h4 = (h4 & h_mask) | (t4 & t_mask) + + // h %= 2^128 + h0 |= h1 << 26 + h1 = ((h1 >> 6) | (h2 << 20)) + h2 = ((h2 >> 12) | (h3 << 14)) + h3 = ((h3 >> 18) | (h4 << 8)) + + // s: the s part of the key + // tag = (h + s) % (2^128) + t := uint64(h0) + uint64(s[0]) + h0 = uint32(t) + t = uint64(h1) + uint64(s[1]) + (t >> 32) + h1 = uint32(t) + t = uint64(h2) + uint64(s[2]) + (t >> 32) + h2 = uint32(t) + t = uint64(h3) + uint64(s[3]) + (t >> 32) + h3 = uint32(t) + + binary.LittleEndian.PutUint32(out[0:], h0) + binary.LittleEndian.PutUint32(out[4:], h1) + binary.LittleEndian.PutUint32(out[8:], h2) + binary.LittleEndian.PutUint32(out[12:], h3) +} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_noasm.go b/vendor/golang.org/x/crypto/poly1305/sum_noasm.go index 751eec52..fcdef46a 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_noasm.go +++ b/vendor/golang.org/x/crypto/poly1305/sum_noasm.go @@ -10,5 +10,7 @@ package poly1305 // 16-byte result into out. Authenticating two different messages with the same // key allows an attacker to forge messages at will. func Sum(out *[TagSize]byte, msg []byte, key *[32]byte) { - sumGeneric(out, msg, key) + h := newMAC(key) + h.Write(msg) + h.Sum(out) } diff --git a/vendor/golang.org/x/crypto/poly1305/sum_ref.go b/vendor/golang.org/x/crypto/poly1305/sum_ref.go deleted file mode 100644 index c4d59bd0..00000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_ref.go +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package poly1305 - -import "encoding/binary" - -// sumGeneric generates an authenticator for msg using a one-time key and -// puts the 16-byte result into out. This is the generic implementation of -// Sum and should be called if no assembly implementation is available. -func sumGeneric(out *[TagSize]byte, msg []byte, key *[32]byte) { - var ( - h0, h1, h2, h3, h4 uint32 // the hash accumulators - r0, r1, r2, r3, r4 uint64 // the r part of the key - ) - - r0 = uint64(binary.LittleEndian.Uint32(key[0:]) & 0x3ffffff) - r1 = uint64((binary.LittleEndian.Uint32(key[3:]) >> 2) & 0x3ffff03) - r2 = uint64((binary.LittleEndian.Uint32(key[6:]) >> 4) & 0x3ffc0ff) - r3 = uint64((binary.LittleEndian.Uint32(key[9:]) >> 6) & 0x3f03fff) - r4 = uint64((binary.LittleEndian.Uint32(key[12:]) >> 8) & 0x00fffff) - - R1, R2, R3, R4 := r1*5, r2*5, r3*5, r4*5 - - for len(msg) >= TagSize { - // h += msg - h0 += binary.LittleEndian.Uint32(msg[0:]) & 0x3ffffff - h1 += (binary.LittleEndian.Uint32(msg[3:]) >> 2) & 0x3ffffff - h2 += (binary.LittleEndian.Uint32(msg[6:]) >> 4) & 0x3ffffff - h3 += (binary.LittleEndian.Uint32(msg[9:]) >> 6) & 0x3ffffff - h4 += (binary.LittleEndian.Uint32(msg[12:]) >> 8) | (1 << 24) - - // h *= r - d0 := (uint64(h0) * r0) + (uint64(h1) * R4) + (uint64(h2) * R3) + (uint64(h3) * R2) + (uint64(h4) * R1) - d1 := (d0 >> 26) + (uint64(h0) * r1) + (uint64(h1) * r0) + (uint64(h2) * R4) + (uint64(h3) * R3) + (uint64(h4) * R2) - d2 := (d1 >> 26) + (uint64(h0) * r2) + (uint64(h1) * r1) + (uint64(h2) * r0) + (uint64(h3) * R4) + (uint64(h4) * R3) - d3 := (d2 >> 26) + (uint64(h0) * r3) + (uint64(h1) * r2) + (uint64(h2) * r1) + (uint64(h3) * r0) + (uint64(h4) * R4) - d4 := (d3 >> 26) + (uint64(h0) * r4) + (uint64(h1) * r3) + (uint64(h2) * r2) + (uint64(h3) * r1) + (uint64(h4) * r0) - - // h %= p - h0 = uint32(d0) & 0x3ffffff - h1 = uint32(d1) & 0x3ffffff - h2 = uint32(d2) & 0x3ffffff - h3 = uint32(d3) & 0x3ffffff - h4 = uint32(d4) & 0x3ffffff - - h0 += uint32(d4>>26) * 5 - h1 += h0 >> 26 - h0 = h0 & 0x3ffffff - - msg = msg[TagSize:] - } - - if len(msg) > 0 { - var block [TagSize]byte - off := copy(block[:], msg) - block[off] = 0x01 - - // h += msg - h0 += binary.LittleEndian.Uint32(block[0:]) & 0x3ffffff - h1 += (binary.LittleEndian.Uint32(block[3:]) >> 2) & 0x3ffffff - h2 += (binary.LittleEndian.Uint32(block[6:]) >> 4) & 0x3ffffff - h3 += (binary.LittleEndian.Uint32(block[9:]) >> 6) & 0x3ffffff - h4 += (binary.LittleEndian.Uint32(block[12:]) >> 8) - - // h *= r - d0 := (uint64(h0) * r0) + (uint64(h1) * R4) + (uint64(h2) * R3) + (uint64(h3) * R2) + (uint64(h4) * R1) - d1 := (d0 >> 26) + (uint64(h0) * r1) + (uint64(h1) * r0) + (uint64(h2) * R4) + (uint64(h3) * R3) + (uint64(h4) * R2) - d2 := (d1 >> 26) + (uint64(h0) * r2) + (uint64(h1) * r1) + (uint64(h2) * r0) + (uint64(h3) * R4) + (uint64(h4) * R3) - d3 := (d2 >> 26) + (uint64(h0) * r3) + (uint64(h1) * r2) + (uint64(h2) * r1) + (uint64(h3) * r0) + (uint64(h4) * R4) - d4 := (d3 >> 26) + (uint64(h0) * r4) + (uint64(h1) * r3) + (uint64(h2) * r2) + (uint64(h3) * r1) + (uint64(h4) * r0) - - // h %= p - h0 = uint32(d0) & 0x3ffffff - h1 = uint32(d1) & 0x3ffffff - h2 = uint32(d2) & 0x3ffffff - h3 = uint32(d3) & 0x3ffffff - h4 = uint32(d4) & 0x3ffffff - - h0 += uint32(d4>>26) * 5 - h1 += h0 >> 26 - h0 = h0 & 0x3ffffff - } - - // h %= p reduction - h2 += h1 >> 26 - h1 &= 0x3ffffff - h3 += h2 >> 26 - h2 &= 0x3ffffff - h4 += h3 >> 26 - h3 &= 0x3ffffff - h0 += 5 * (h4 >> 26) - h4 &= 0x3ffffff - h1 += h0 >> 26 - h0 &= 0x3ffffff - - // h - p - t0 := h0 + 5 - t1 := h1 + (t0 >> 26) - t2 := h2 + (t1 >> 26) - t3 := h3 + (t2 >> 26) - t4 := h4 + (t3 >> 26) - (1 << 26) - t0 &= 0x3ffffff - t1 &= 0x3ffffff - t2 &= 0x3ffffff - t3 &= 0x3ffffff - - // select h if h < p else h - p - t_mask := (t4 >> 31) - 1 - h_mask := ^t_mask - h0 = (h0 & h_mask) | (t0 & t_mask) - h1 = (h1 & h_mask) | (t1 & t_mask) - h2 = (h2 & h_mask) | (t2 & t_mask) - h3 = (h3 & h_mask) | (t3 & t_mask) - h4 = (h4 & h_mask) | (t4 & t_mask) - - // h %= 2^128 - h0 |= h1 << 26 - h1 = ((h1 >> 6) | (h2 << 20)) - h2 = ((h2 >> 12) | (h3 << 14)) - h3 = ((h3 >> 18) | (h4 << 8)) - - // s: the s part of the key - // tag = (h + s) % (2^128) - t := uint64(h0) + uint64(binary.LittleEndian.Uint32(key[16:])) - h0 = uint32(t) - t = uint64(h1) + uint64(binary.LittleEndian.Uint32(key[20:])) + (t >> 32) - h1 = uint32(t) - t = uint64(h2) + uint64(binary.LittleEndian.Uint32(key[24:])) + (t >> 32) - h2 = uint32(t) - t = uint64(h3) + uint64(binary.LittleEndian.Uint32(key[28:])) + (t >> 32) - h3 = uint32(t) - - binary.LittleEndian.PutUint32(out[0:], h0) - binary.LittleEndian.PutUint32(out[4:], h1) - binary.LittleEndian.PutUint32(out[8:], h2) - binary.LittleEndian.PutUint32(out[12:], h3) -} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_s390x.go b/vendor/golang.org/x/crypto/poly1305/sum_s390x.go index 7a266cec..ec99e07e 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_s390x.go +++ b/vendor/golang.org/x/crypto/poly1305/sum_s390x.go @@ -6,16 +6,9 @@ package poly1305 -// hasVectorFacility reports whether the machine supports -// the vector facility (vx). -func hasVectorFacility() bool - -// hasVMSLFacility reports whether the machine supports -// Vector Multiply Sum Logical (VMSL). -func hasVMSLFacility() bool - -var hasVX = hasVectorFacility() -var hasVMSL = hasVMSLFacility() +import ( + "golang.org/x/sys/cpu" +) // poly1305vx is an assembly implementation of Poly1305 that uses vector // instructions. It must only be called if the vector facility (vx) is @@ -33,12 +26,12 @@ func poly1305vmsl(out *[16]byte, m *byte, mlen uint64, key *[32]byte) // 16-byte result into out. Authenticating two different messages with the same // key allows an attacker to forge messages at will. func Sum(out *[16]byte, m []byte, key *[32]byte) { - if hasVX { + if cpu.S390X.HasVX { var mPtr *byte if len(m) > 0 { mPtr = &m[0] } - if hasVMSL && len(m) > 256 { + if cpu.S390X.HasVXE && len(m) > 256 { poly1305vmsl(out, mPtr, uint64(len(m)), key) } else { poly1305vx(out, mPtr, uint64(len(m)), key) diff --git a/vendor/golang.org/x/crypto/poly1305/sum_s390x.s b/vendor/golang.org/x/crypto/poly1305/sum_s390x.s index 356c07a6..ca5a309d 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_s390x.s +++ b/vendor/golang.org/x/crypto/poly1305/sum_s390x.s @@ -376,25 +376,3 @@ b1: MOVD $0, R3 BR multiply - -TEXT ·hasVectorFacility(SB), NOSPLIT, $24-1 - MOVD $x-24(SP), R1 - XC $24, 0(R1), 0(R1) // clear the storage - MOVD $2, R0 // R0 is the number of double words stored -1 - WORD $0xB2B01000 // STFLE 0(R1) - XOR R0, R0 // reset the value of R0 - MOVBZ z-8(SP), R1 - AND $0x40, R1 - BEQ novector - -vectorinstalled: - // check if the vector instruction has been enabled - VLEIB $0, $0xF, V16 - VLGVB $0, V16, R1 - CMPBNE R1, $0xF, novector - MOVB $1, ret+0(FP) // have vx - RET - -novector: - MOVB $0, ret+0(FP) // no vx - RET diff --git a/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s b/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s index e548020b..e60bbc1d 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s +++ b/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s @@ -907,25 +907,3 @@ square: MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) BR next - -TEXT ·hasVMSLFacility(SB), NOSPLIT, $24-1 - MOVD $x-24(SP), R1 - XC $24, 0(R1), 0(R1) // clear the storage - MOVD $2, R0 // R0 is the number of double words stored -1 - WORD $0xB2B01000 // STFLE 0(R1) - XOR R0, R0 // reset the value of R0 - MOVBZ z-8(SP), R1 - AND $0x01, R1 - BEQ novmsl - -vectorinstalled: - // check if the vector instruction has been enabled - VLEIB $0, $0xF, V16 - VLGVB $0, V16, R1 - CMPBNE R1, $0xF, novmsl - MOVB $1, ret+0(FP) // have vx - RET - -novmsl: - MOVB $0, ret+0(FP) // no vx - RET diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go index 6cb8a950..5cfdf8f3 100644 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go +++ b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go @@ -64,13 +64,15 @@ func Restore(fd int, state *State) error { return windows.SetConsoleMode(windows.Handle(fd), state.mode) } -// GetSize returns the dimensions of the given terminal. +// GetSize returns the visible dimensions of the given terminal. +// +// These dimensions don't include any scrollback buffer height. func GetSize(fd int) (width, height int, err error) { var info windows.ConsoleScreenBufferInfo if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil { return 0, 0, err } - return int(info.Size.X), int(info.Size.Y), nil + return int(info.Window.Right - info.Window.Left + 1), int(info.Window.Bottom - info.Window.Top + 1), nil } // ReadPassword reads a line of input from a terminal without local echo. This diff --git a/vendor/golang.org/x/sys/cpu/byteorder.go b/vendor/golang.org/x/sys/cpu/byteorder.go new file mode 100644 index 00000000..da6b9e43 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/byteorder.go @@ -0,0 +1,30 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cpu + +import ( + "encoding/binary" + "runtime" +) + +// hostByteOrder returns binary.LittleEndian on little-endian machines and +// binary.BigEndian on big-endian machines. +func hostByteOrder() binary.ByteOrder { + switch runtime.GOARCH { + case "386", "amd64", "amd64p32", + "arm", "arm64", + "mipsle", "mips64le", "mips64p32le", + "ppc64le", + "riscv", "riscv64": + return binary.LittleEndian + case "armbe", "arm64be", + "mips", "mips64", "mips64p32", + "ppc", "ppc64", + "s390", "s390x", + "sparc", "sparc64": + return binary.BigEndian + } + panic("unknown architecture") +} diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go new file mode 100644 index 00000000..6b0034ec --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -0,0 +1,89 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package cpu implements processor feature detection for +// various CPU architectures. +package cpu + +// CacheLinePad is used to pad structs to avoid false sharing. +type CacheLinePad struct{ _ [cacheLineSize]byte } + +// X86 contains the supported CPU features of the +// current X86/AMD64 platform. If the current platform +// is not X86/AMD64 then all feature flags are false. +// +// X86 is padded to avoid false sharing. Further the HasAVX +// and HasAVX2 are only set if the OS supports XMM and YMM +// registers in addition to the CPUID feature bit being set. +var X86 struct { + _ CacheLinePad + HasAES bool // AES hardware implementation (AES NI) + HasADX bool // Multi-precision add-carry instruction extensions + HasAVX bool // Advanced vector extension + HasAVX2 bool // Advanced vector extension 2 + HasBMI1 bool // Bit manipulation instruction set 1 + HasBMI2 bool // Bit manipulation instruction set 2 + HasERMS bool // Enhanced REP for MOVSB and STOSB + HasFMA bool // Fused-multiply-add instructions + HasOSXSAVE bool // OS supports XSAVE/XRESTOR for saving/restoring XMM registers. + HasPCLMULQDQ bool // PCLMULQDQ instruction - most often used for AES-GCM + HasPOPCNT bool // Hamming weight instruction POPCNT. + HasRDRAND bool // RDRAND instruction (on-chip random number generator) + HasRDSEED bool // RDSEED instruction (on-chip random number generator) + HasSSE2 bool // Streaming SIMD extension 2 (always available on amd64) + HasSSE3 bool // Streaming SIMD extension 3 + HasSSSE3 bool // Supplemental streaming SIMD extension 3 + HasSSE41 bool // Streaming SIMD extension 4 and 4.1 + HasSSE42 bool // Streaming SIMD extension 4 and 4.2 + _ CacheLinePad +} + +// ARM64 contains the supported CPU features of the +// current ARMv8(aarch64) platform. If the current platform +// is not arm64 then all feature flags are false. +var ARM64 struct { + _ CacheLinePad + HasFP bool // Floating-point instruction set (always available) + HasASIMD bool // Advanced SIMD (always available) + HasEVTSTRM bool // Event stream support + HasAES bool // AES hardware implementation + HasPMULL bool // Polynomial multiplication instruction set + HasSHA1 bool // SHA1 hardware implementation + HasSHA2 bool // SHA2 hardware implementation + HasCRC32 bool // CRC32 hardware implementation + HasATOMICS bool // Atomic memory operation instruction set + HasFPHP bool // Half precision floating-point instruction set + HasASIMDHP bool // Advanced SIMD half precision instruction set + HasCPUID bool // CPUID identification scheme registers + HasASIMDRDM bool // Rounding double multiply add/subtract instruction set + HasJSCVT bool // Javascript conversion from floating-point to integer + HasFCMA bool // Floating-point multiplication and addition of complex numbers + HasLRCPC bool // Release Consistent processor consistent support + HasDCPOP bool // Persistent memory support + HasSHA3 bool // SHA3 hardware implementation + HasSM3 bool // SM3 hardware implementation + HasSM4 bool // SM4 hardware implementation + HasASIMDDP bool // Advanced SIMD double precision instruction set + HasSHA512 bool // SHA512 hardware implementation + HasSVE bool // Scalable Vector Extensions + HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32 + _ CacheLinePad +} + +// PPC64 contains the supported CPU features of the current ppc64/ppc64le platforms. +// If the current platform is not ppc64/ppc64le then all feature flags are false. +// +// For ppc64/ppc64le, it is safe to check only for ISA level starting on ISA v3.00, +// since there are no optional categories. There are some exceptions that also +// require kernel support to work (DARN, SCV), so there are feature bits for +// those as well. The minimum processor requirement is POWER8 (ISA 2.07). +// The struct is padded to avoid false sharing. +var PPC64 struct { + _ CacheLinePad + HasDARN bool // Hardware random number generator (requires kernel enablement) + HasSCV bool // Syscall vectored (requires kernel enablement) + IsPOWER8 bool // ISA v2.07 (POWER8) + IsPOWER9 bool // ISA v3.00 (POWER9) + _ CacheLinePad +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm.go b/vendor/golang.org/x/sys/cpu/cpu_arm.go new file mode 100644 index 00000000..7f2348b7 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_arm.go @@ -0,0 +1,9 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cpu + +const cacheLineSize = 32 + +func doinit() {} diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go new file mode 100644 index 00000000..f7cb4697 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go @@ -0,0 +1,16 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build 386 amd64 amd64p32 +// +build !gccgo + +package cpu + +// cpuid is implemented in cpu_x86.s for gc compiler +// and in cpu_gccgo.c for gccgo. +func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) + +// xgetbv with ecx = 0 is implemented in cpu_x86.s for gc compiler +// and in cpu_gccgo.c for gccgo. +func xgetbv() (eax, edx uint32) diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo.c b/vendor/golang.org/x/sys/cpu/cpu_gccgo.c new file mode 100644 index 00000000..e363c7d1 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo.c @@ -0,0 +1,43 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build 386 amd64 amd64p32 +// +build gccgo + +#include +#include + +// Need to wrap __get_cpuid_count because it's declared as static. +int +gccgoGetCpuidCount(uint32_t leaf, uint32_t subleaf, + uint32_t *eax, uint32_t *ebx, + uint32_t *ecx, uint32_t *edx) +{ + return __get_cpuid_count(leaf, subleaf, eax, ebx, ecx, edx); +} + +// xgetbv reads the contents of an XCR (Extended Control Register) +// specified in the ECX register into registers EDX:EAX. +// Currently, the only supported value for XCR is 0. +// +// TODO: Replace with a better alternative: +// +// #include +// +// #pragma GCC target("xsave") +// +// void gccgoXgetbv(uint32_t *eax, uint32_t *edx) { +// unsigned long long x = _xgetbv(0); +// *eax = x & 0xffffffff; +// *edx = (x >> 32) & 0xffffffff; +// } +// +// Note that _xgetbv is defined starting with GCC 8. +void +gccgoXgetbv(uint32_t *eax, uint32_t *edx) +{ + __asm(" xorl %%ecx, %%ecx\n" + " xgetbv" + : "=a"(*eax), "=d"(*edx)); +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo.go new file mode 100644 index 00000000..ba49b91b --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo.go @@ -0,0 +1,26 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build 386 amd64 amd64p32 +// +build gccgo + +package cpu + +//extern gccgoGetCpuidCount +func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32) + +func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) { + var a, b, c, d uint32 + gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d) + return a, b, c, d +} + +//extern gccgoXgetbv +func gccgoXgetbv(eax, edx *uint32) + +func xgetbv() (eax, edx uint32) { + var a, d uint32 + gccgoXgetbv(&a, &d) + return a, d +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux.go b/vendor/golang.org/x/sys/cpu/cpu_linux.go new file mode 100644 index 00000000..33b61e52 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_linux.go @@ -0,0 +1,55 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//+build !amd64,!amd64p32,!386 + +package cpu + +import ( + "io/ioutil" +) + +const ( + _AT_HWCAP = 16 + _AT_HWCAP2 = 26 + + procAuxv = "/proc/self/auxv" + + uintSize = int(32 << (^uint(0) >> 63)) +) + +// For those platforms don't have a 'cpuid' equivalent we use HWCAP/HWCAP2 +// These are initialized in cpu_$GOARCH.go +// and should not be changed after they are initialized. +var hwCap uint +var hwCap2 uint + +func init() { + buf, err := ioutil.ReadFile(procAuxv) + if err != nil { + panic("read proc auxv failed: " + err.Error()) + } + + bo := hostByteOrder() + for len(buf) >= 2*(uintSize/8) { + var tag, val uint + switch uintSize { + case 32: + tag = uint(bo.Uint32(buf[0:])) + val = uint(bo.Uint32(buf[4:])) + buf = buf[8:] + case 64: + tag = uint(bo.Uint64(buf[0:])) + val = uint(bo.Uint64(buf[8:])) + buf = buf[16:] + } + switch tag { + case _AT_HWCAP: + hwCap = val + case _AT_HWCAP2: + hwCap2 = val + } + } + doinit() +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go new file mode 100644 index 00000000..fa7fb1bd --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go @@ -0,0 +1,67 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cpu + +const cacheLineSize = 64 + +// HWCAP/HWCAP2 bits. These are exposed by Linux. +const ( + hwcap_FP = 1 << 0 + hwcap_ASIMD = 1 << 1 + hwcap_EVTSTRM = 1 << 2 + hwcap_AES = 1 << 3 + hwcap_PMULL = 1 << 4 + hwcap_SHA1 = 1 << 5 + hwcap_SHA2 = 1 << 6 + hwcap_CRC32 = 1 << 7 + hwcap_ATOMICS = 1 << 8 + hwcap_FPHP = 1 << 9 + hwcap_ASIMDHP = 1 << 10 + hwcap_CPUID = 1 << 11 + hwcap_ASIMDRDM = 1 << 12 + hwcap_JSCVT = 1 << 13 + hwcap_FCMA = 1 << 14 + hwcap_LRCPC = 1 << 15 + hwcap_DCPOP = 1 << 16 + hwcap_SHA3 = 1 << 17 + hwcap_SM3 = 1 << 18 + hwcap_SM4 = 1 << 19 + hwcap_ASIMDDP = 1 << 20 + hwcap_SHA512 = 1 << 21 + hwcap_SVE = 1 << 22 + hwcap_ASIMDFHM = 1 << 23 +) + +func doinit() { + // HWCAP feature bits + ARM64.HasFP = isSet(hwCap, hwcap_FP) + ARM64.HasASIMD = isSet(hwCap, hwcap_ASIMD) + ARM64.HasEVTSTRM = isSet(hwCap, hwcap_EVTSTRM) + ARM64.HasAES = isSet(hwCap, hwcap_AES) + ARM64.HasPMULL = isSet(hwCap, hwcap_PMULL) + ARM64.HasSHA1 = isSet(hwCap, hwcap_SHA1) + ARM64.HasSHA2 = isSet(hwCap, hwcap_SHA2) + ARM64.HasCRC32 = isSet(hwCap, hwcap_CRC32) + ARM64.HasATOMICS = isSet(hwCap, hwcap_ATOMICS) + ARM64.HasFPHP = isSet(hwCap, hwcap_FPHP) + ARM64.HasASIMDHP = isSet(hwCap, hwcap_ASIMDHP) + ARM64.HasCPUID = isSet(hwCap, hwcap_CPUID) + ARM64.HasASIMDRDM = isSet(hwCap, hwcap_ASIMDRDM) + ARM64.HasJSCVT = isSet(hwCap, hwcap_JSCVT) + ARM64.HasFCMA = isSet(hwCap, hwcap_FCMA) + ARM64.HasLRCPC = isSet(hwCap, hwcap_LRCPC) + ARM64.HasDCPOP = isSet(hwCap, hwcap_DCPOP) + ARM64.HasSHA3 = isSet(hwCap, hwcap_SHA3) + ARM64.HasSM3 = isSet(hwCap, hwcap_SM3) + ARM64.HasSM4 = isSet(hwCap, hwcap_SM4) + ARM64.HasASIMDDP = isSet(hwCap, hwcap_ASIMDDP) + ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512) + ARM64.HasSVE = isSet(hwCap, hwcap_SVE) + ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM) +} + +func isSet(hwc uint, value uint) bool { + return hwc&value != 0 +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go new file mode 100644 index 00000000..6c8d975d --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go @@ -0,0 +1,33 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux +// +build ppc64 ppc64le + +package cpu + +const cacheLineSize = 128 + +// HWCAP/HWCAP2 bits. These are exposed by the kernel. +const ( + // ISA Level + _PPC_FEATURE2_ARCH_2_07 = 0x80000000 + _PPC_FEATURE2_ARCH_3_00 = 0x00800000 + + // CPU features + _PPC_FEATURE2_DARN = 0x00200000 + _PPC_FEATURE2_SCV = 0x00100000 +) + +func doinit() { + // HWCAP2 feature bits + PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07) + PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00) + PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN) + PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV) +} + +func isSet(hwc uint, value uint) bool { + return hwc&value != 0 +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_mips64x.go b/vendor/golang.org/x/sys/cpu/cpu_mips64x.go new file mode 100644 index 00000000..f55e0c82 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_mips64x.go @@ -0,0 +1,11 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build mips64 mips64le + +package cpu + +const cacheLineSize = 32 + +func doinit() {} diff --git a/vendor/golang.org/x/sys/cpu/cpu_mipsx.go b/vendor/golang.org/x/sys/cpu/cpu_mipsx.go new file mode 100644 index 00000000..cda87b1a --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_mipsx.go @@ -0,0 +1,11 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build mips mipsle + +package cpu + +const cacheLineSize = 32 + +func doinit() {} diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go new file mode 100644 index 00000000..dd1e76dc --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go @@ -0,0 +1,11 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !linux,arm64 + +package cpu + +const cacheLineSize = 64 + +func doinit() {} diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go new file mode 100644 index 00000000..3053b4b9 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go @@ -0,0 +1,12 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !linux +// +build ppc64 ppc64le + +package cpu + +const cacheLineSize = 128 + +func doinit() {} diff --git a/vendor/golang.org/x/sys/cpu/cpu_s390x.go b/vendor/golang.org/x/sys/cpu/cpu_s390x.go new file mode 100644 index 00000000..ce8a2289 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_s390x.go @@ -0,0 +1,9 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cpu + +const cacheLineSize = 256 + +func doinit() {} diff --git a/vendor/golang.org/x/sys/cpu/cpu_x86.go b/vendor/golang.org/x/sys/cpu/cpu_x86.go new file mode 100644 index 00000000..2b3ca2e1 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_x86.go @@ -0,0 +1,57 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build 386 amd64 amd64p32 + +package cpu + +const cacheLineSize = 64 + +func init() { + maxID, _, _, _ := cpuid(0, 0) + + if maxID < 1 { + return + } + + _, _, ecx1, edx1 := cpuid(1, 0) + X86.HasSSE2 = isSet(26, edx1) + + X86.HasSSE3 = isSet(0, ecx1) + X86.HasPCLMULQDQ = isSet(1, ecx1) + X86.HasSSSE3 = isSet(9, ecx1) + X86.HasFMA = isSet(12, ecx1) + X86.HasSSE41 = isSet(19, ecx1) + X86.HasSSE42 = isSet(20, ecx1) + X86.HasPOPCNT = isSet(23, ecx1) + X86.HasAES = isSet(25, ecx1) + X86.HasOSXSAVE = isSet(27, ecx1) + X86.HasRDRAND = isSet(30, ecx1) + + osSupportsAVX := false + // For XGETBV, OSXSAVE bit is required and sufficient. + if X86.HasOSXSAVE { + eax, _ := xgetbv() + // Check if XMM and YMM registers have OS support. + osSupportsAVX = isSet(1, eax) && isSet(2, eax) + } + + X86.HasAVX = isSet(28, ecx1) && osSupportsAVX + + if maxID < 7 { + return + } + + _, ebx7, _, _ := cpuid(7, 0) + X86.HasBMI1 = isSet(3, ebx7) + X86.HasAVX2 = isSet(5, ebx7) && osSupportsAVX + X86.HasBMI2 = isSet(8, ebx7) + X86.HasERMS = isSet(9, ebx7) + X86.HasRDSEED = isSet(18, ebx7) + X86.HasADX = isSet(19, ebx7) +} + +func isSet(bitpos uint, value uint32) bool { + return value&(1< + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/chat.go b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/chat.go new file mode 100644 index 00000000..b601eb46 --- /dev/null +++ b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/chat.go @@ -0,0 +1,147 @@ +// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. +// Copyright (C) 2019 Tulir Asokan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package whatsappExt + +import ( + "encoding/json" + "strings" + + "github.com/Rhymen/go-whatsapp" +) + +type ChatUpdateCommand string + +const ( + ChatUpdateCommandAction ChatUpdateCommand = "action" +) + +type ChatUpdate struct { + JID string `json:"id"` + Command ChatUpdateCommand `json:"cmd"` + Data ChatUpdateData `json:"data"` +} + +type ChatActionType string + +const ( + ChatActionNameChange ChatActionType = "subject" + ChatActionAddTopic ChatActionType = "desc_add" + ChatActionRemoveTopic ChatActionType = "desc_remove" + ChatActionRestrict ChatActionType = "restrict" + ChatActionAnnounce ChatActionType = "announce" + ChatActionPromote ChatActionType = "promote" + ChatActionDemote ChatActionType = "demote" +) + +type ChatUpdateData struct { + Action ChatActionType + SenderJID string + + NameChange struct { + Name string `json:"subject"` + SetAt int64 `json:"s_t"` + SetBy string `json:"s_o"` + } + + AddTopic struct { + Topic string `json:"desc"` + ID string `json:"descId"` + SetAt int64 `json:"descTime"` + } + + RemoveTopic struct { + ID string `json:"descId"` + } + + Restrict bool + + Announce bool + + PermissionChange struct { + JIDs []string `json:"participants"` + } +} + +func (cud *ChatUpdateData) UnmarshalJSON(data []byte) error { + var arr []json.RawMessage + err := json.Unmarshal(data, &arr) + if err != nil { + return err + } else if len(arr) < 3 { + return nil + } + + err = json.Unmarshal(arr[0], &cud.Action) + if err != nil { + return err + } + + err = json.Unmarshal(arr[1], &cud.SenderJID) + if err != nil { + return err + } + cud.SenderJID = strings.Replace(cud.SenderJID, OldUserSuffix, NewUserSuffix, 1) + + var unmarshalTo interface{} + switch cud.Action { + case ChatActionNameChange: + unmarshalTo = &cud.NameChange + case ChatActionAddTopic: + unmarshalTo = &cud.AddTopic + case ChatActionRemoveTopic: + unmarshalTo = &cud.RemoveTopic + case ChatActionRestrict: + unmarshalTo = &cud.Restrict + case ChatActionAnnounce: + unmarshalTo = &cud.Announce + case ChatActionPromote, ChatActionDemote: + unmarshalTo = &cud.PermissionChange + default: + return nil + } + err = json.Unmarshal(arr[2], unmarshalTo) + if err != nil { + return err + } + cud.NameChange.SetBy = strings.Replace(cud.NameChange.SetBy, OldUserSuffix, NewUserSuffix, 1) + for index, jid := range cud.PermissionChange.JIDs { + cud.PermissionChange.JIDs[index] = strings.Replace(jid, OldUserSuffix, NewUserSuffix, 1) + } + return nil +} + +type ChatUpdateHandler interface { + whatsapp.Handler + HandleChatUpdate(ChatUpdate) +} + +func (ext *ExtendedConn) handleMessageChatUpdate(message []byte) { + var event ChatUpdate + err := json.Unmarshal(message, &event) + if err != nil { + ext.jsonParseError(err) + return + } + event.JID = strings.Replace(event.JID, OldUserSuffix, NewUserSuffix, 1) + for _, handler := range ext.handlers { + chatUpdateHandler, ok := handler.(ChatUpdateHandler) + if !ok { + continue + } + go chatUpdateHandler.HandleChatUpdate(event) + } +} diff --git a/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/cmd.go b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/cmd.go new file mode 100644 index 00000000..ac34d45d --- /dev/null +++ b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/cmd.go @@ -0,0 +1,59 @@ +// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. +// Copyright (C) 2019 Tulir Asokan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package whatsappExt + +import ( + "encoding/json" + "strings" + + "github.com/Rhymen/go-whatsapp" +) + +type CommandType string + +const ( + CommandPicture CommandType = "picture" +) + +type Command struct { + Type CommandType `json:"type"` + JID string `json:"jid"` + + *ProfilePicInfo +} + +type CommandHandler interface { + whatsapp.Handler + HandleCommand(Command) +} + +func (ext *ExtendedConn) handleMessageCommand(message []byte) { + var event Command + err := json.Unmarshal(message, &event) + if err != nil { + ext.jsonParseError(err) + return + } + event.JID = strings.Replace(event.JID, OldUserSuffix, NewUserSuffix, 1) + for _, handler := range ext.handlers { + commandHandler, ok := handler.(CommandHandler) + if !ok { + continue + } + go commandHandler.HandleCommand(event) + } +} diff --git a/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/conn.go b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/conn.go new file mode 100644 index 00000000..9f722514 --- /dev/null +++ b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/conn.go @@ -0,0 +1,60 @@ +// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. +// Copyright (C) 2019 Tulir Asokan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package whatsappExt + +import ( + "encoding/json" + + "github.com/Rhymen/go-whatsapp" +) + +type ConnInfo struct { + ProtocolVersion []int `json:"protoVersion"` + BinaryVersion int `json:"binVersion"` + Phone struct { + WhatsAppVersion string `json:"wa_version"` + MCC string `json:"mcc"` + MNC string `json:"mnc"` + OSVersion string `json:"os_version"` + DeviceManufacturer string `json:"device_manufacturer"` + DeviceModel string `json:"device_model"` + OSBuildNumber string `json:"os_build_number"` + } `json:"phone"` + Features map[string]interface{} `json:"features"` + PushName string `json:"pushname"` +} + +type ConnInfoHandler interface { + whatsapp.Handler + HandleConnInfo(ConnInfo) +} + +func (ext *ExtendedConn) handleMessageConn(message []byte) { + var event ConnInfo + err := json.Unmarshal(message, &event) + if err != nil { + ext.jsonParseError(err) + return + } + for _, handler := range ext.handlers { + connInfoHandler, ok := handler.(ConnInfoHandler) + if !ok { + continue + } + connInfoHandler.HandleConnInfo(event) + } +} diff --git a/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/jsonmessage.go b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/jsonmessage.go new file mode 100644 index 00000000..11748443 --- /dev/null +++ b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/jsonmessage.go @@ -0,0 +1,102 @@ +// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. +// Copyright (C) 2019 Tulir Asokan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package whatsappExt + +import ( + "encoding/json" + + "github.com/Rhymen/go-whatsapp" +) + +type JSONMessage []json.RawMessage + +type JSONMessageType string + +const ( + MessageMsgInfo JSONMessageType = "MsgInfo" + MessageMsg JSONMessageType = "Msg" + MessagePresence JSONMessageType = "Presence" + MessageStream JSONMessageType = "Stream" + MessageConn JSONMessageType = "Conn" + MessageProps JSONMessageType = "Props" + MessageCmd JSONMessageType = "Cmd" + MessageChat JSONMessageType = "Chat" +) + +func (ext *ExtendedConn) AddHandler(handler whatsapp.Handler) { + ext.Conn.AddHandler(handler) + ext.handlers = append(ext.handlers, handler) +} + +func (ext *ExtendedConn) HandleError(error) {} + +type UnhandledJSONMessageHandler interface { + whatsapp.Handler + HandleUnhandledJSONMessage(string) +} + +type JSONParseErrorHandler interface { + whatsapp.Handler + HandleJSONParseError(error) +} + +func (ext *ExtendedConn) jsonParseError(err error) { + for _, handler := range ext.handlers { + errorHandler, ok := handler.(JSONParseErrorHandler) + if !ok { + continue + } + errorHandler.HandleJSONParseError(err) + } +} + +func (ext *ExtendedConn) HandleJsonMessage(message string) { + msg := JSONMessage{} + err := json.Unmarshal([]byte(message), &msg) + if err != nil || len(msg) < 2 { + ext.jsonParseError(err) + return + } + + var msgType JSONMessageType + json.Unmarshal(msg[0], &msgType) + + switch msgType { + case MessagePresence: + ext.handleMessagePresence(msg[1]) + case MessageStream: + ext.handleMessageStream(msg[1:]) + case MessageConn: + ext.handleMessageConn(msg[1]) + case MessageProps: + ext.handleMessageProps(msg[1]) + case MessageMsgInfo, MessageMsg: + ext.handleMessageMsgInfo(msgType, msg[1]) + case MessageCmd: + ext.handleMessageCommand(msg[1]) + case MessageChat: + ext.handleMessageChatUpdate(msg[1]) + default: + for _, handler := range ext.handlers { + ujmHandler, ok := handler.(UnhandledJSONMessageHandler) + if !ok { + continue + } + ujmHandler.HandleUnhandledJSONMessage(message) + } + } +} diff --git a/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/msginfo.go b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/msginfo.go new file mode 100644 index 00000000..2366e3f4 --- /dev/null +++ b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/msginfo.go @@ -0,0 +1,90 @@ +// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. +// Copyright (C) 2019 Tulir Asokan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package whatsappExt + +import ( + "encoding/json" + "strings" + + "github.com/Rhymen/go-whatsapp" +) + +type MsgInfoCommand string + +const ( + MsgInfoCommandAck MsgInfoCommand = "ack" + MsgInfoCommandAcks MsgInfoCommand = "acks" +) + +type Acknowledgement int + +const ( + AckMessageSent Acknowledgement = 1 + AckMessageDelivered Acknowledgement = 2 + AckMessageRead Acknowledgement = 3 +) + +type JSONStringOrArray []string + +func (jsoa *JSONStringOrArray) UnmarshalJSON(data []byte) error { + var str string + if json.Unmarshal(data, &str) == nil { + *jsoa = []string{str} + return nil + } + var strs []string + json.Unmarshal(data, &strs) + *jsoa = strs + return nil +} + +type MsgInfo struct { + Command MsgInfoCommand `json:"cmd"` + IDs JSONStringOrArray `json:"id"` + Acknowledgement Acknowledgement `json:"ack"` + MessageFromJID string `json:"from"` + SenderJID string `json:"participant"` + ToJID string `json:"to"` + Timestamp int64 `json:"t"` +} + +type MsgInfoHandler interface { + whatsapp.Handler + HandleMsgInfo(MsgInfo) +} + +func (ext *ExtendedConn) handleMessageMsgInfo(msgType JSONMessageType, message []byte) { + var event MsgInfo + err := json.Unmarshal(message, &event) + if err != nil { + ext.jsonParseError(err) + return + } + event.MessageFromJID = strings.Replace(event.MessageFromJID, OldUserSuffix, NewUserSuffix, 1) + event.SenderJID = strings.Replace(event.SenderJID, OldUserSuffix, NewUserSuffix, 1) + event.ToJID = strings.Replace(event.ToJID, OldUserSuffix, NewUserSuffix, 1) + if msgType == MessageMsg { + event.SenderJID = event.ToJID + } + for _, handler := range ext.handlers { + msgInfoHandler, ok := handler.(MsgInfoHandler) + if !ok { + continue + } + go msgInfoHandler.HandleMsgInfo(event) + } +} diff --git a/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/presence.go b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/presence.go new file mode 100644 index 00000000..c70f4e64 --- /dev/null +++ b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/presence.go @@ -0,0 +1,67 @@ +// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. +// Copyright (C) 2019 Tulir Asokan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package whatsappExt + +import ( + "encoding/json" + "strings" + + "github.com/Rhymen/go-whatsapp" +) + +type PresenceType string + +const ( + PresenceUnavailable PresenceType = "unavailable" + PresenceAvailable PresenceType = "available" + PresenceComposing PresenceType = "composing" +) + +type Presence struct { + JID string `json:"id"` + SenderJID string `json:"participant"` + Status PresenceType `json:"type"` + Timestamp int64 `json:"t"` + Deny bool `json:"deny"` +} + +type PresenceHandler interface { + whatsapp.Handler + HandlePresence(Presence) +} + +func (ext *ExtendedConn) handleMessagePresence(message []byte) { + var event Presence + err := json.Unmarshal(message, &event) + if err != nil { + ext.jsonParseError(err) + return + } + event.JID = strings.Replace(event.JID, OldUserSuffix, NewUserSuffix, 1) + if len(event.SenderJID) == 0 { + event.SenderJID = event.JID + } else { + event.SenderJID = strings.Replace(event.SenderJID, OldUserSuffix, NewUserSuffix, 1) + } + for _, handler := range ext.handlers { + presenceHandler, ok := handler.(PresenceHandler) + if !ok { + continue + } + go presenceHandler.HandlePresence(event) + } +} diff --git a/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/props.go b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/props.go new file mode 100644 index 00000000..8f5dbbd7 --- /dev/null +++ b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/props.go @@ -0,0 +1,68 @@ +// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. +// Copyright (C) 2019 Tulir Asokan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package whatsappExt + +import ( + "encoding/json" + + "github.com/Rhymen/go-whatsapp" +) + +type ProtocolProps struct { + WebPresence bool `json:"webPresence"` + NotificationQuery bool `json:"notificationQuery"` + FacebookCrashLog bool `json:"fbCrashlog"` + Bucket string `json:"bucket"` + GIFSearch string `json:"gifSearch"` + Spam bool `json:"SPAM"` + SetBlock bool `json:"SET_BLOCK"` + MessageInfo bool `json:"MESSAGE_INFO"` + MaxFileSize int `json:"maxFileSize"` + Media int `json:"media"` + GroupNameLength int `json:"maxSubject"` + GroupDescriptionLength int `json:"groupDescLength"` + MaxParticipants int `json:"maxParticipants"` + VideoMaxEdge int `json:"videoMaxEdge"` + ImageMaxEdge int `json:"imageMaxEdge"` + ImageMaxKilobytes int `json:"imageMaxKBytes"` + Edit int `json:"edit"` + FwdUIStartTimestamp int `json:"fwdUiStartTs"` + GroupsV3 int `json:"groupsV3"` + RestrictGroups int `json:"restrictGroups"` + AnnounceGroups int `json:"announceGroups"` +} + +type ProtocolPropsHandler interface { + whatsapp.Handler + HandleProtocolProps(ProtocolProps) +} + +func (ext *ExtendedConn) handleMessageProps(message []byte) { + var event ProtocolProps + err := json.Unmarshal(message, &event) + if err != nil { + ext.jsonParseError(err) + return + } + for _, handler := range ext.handlers { + protocolPropsHandler, ok := handler.(ProtocolPropsHandler) + if !ok { + continue + } + go protocolPropsHandler.HandleProtocolProps(event) + } +} diff --git a/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/stream.go b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/stream.go new file mode 100644 index 00000000..85dbbd7d --- /dev/null +++ b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/stream.go @@ -0,0 +1,63 @@ +// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. +// Copyright (C) 2019 Tulir Asokan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package whatsappExt + +import ( + "encoding/json" + + "github.com/Rhymen/go-whatsapp" +) + +type StreamType string + +const ( + StreamUpdate = "update" + StreamSleep = "asleep" +) + +type StreamEvent struct { + Type StreamType + Boolean bool + Version string +} + +type StreamEventHandler interface { + whatsapp.Handler + HandleStreamEvent(StreamEvent) +} + +func (ext *ExtendedConn) handleMessageStream(message []json.RawMessage) { + var event StreamEvent + err := json.Unmarshal(message[0], &event.Type) + if err != nil { + ext.jsonParseError(err) + return + } + + if event.Type == StreamUpdate && len(message) > 4 { + json.Unmarshal(message[1], event.Boolean) + json.Unmarshal(message[2], event.Version) + } + + for _, handler := range ext.handlers { + streamHandler, ok := handler.(StreamEventHandler) + if !ok { + continue + } + go streamHandler.HandleStreamEvent(event) + } +} diff --git a/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/whatsapp.go b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/whatsapp.go new file mode 100644 index 00000000..5e041eac --- /dev/null +++ b/vendor/maunium.net/go/mautrix-whatsapp/whatsapp-ext/whatsapp.go @@ -0,0 +1,132 @@ +// mautrix-whatsapp - A Matrix-WhatsApp puppeting bridge. +// Copyright (C) 2019 Tulir Asokan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package whatsappExt + +import ( + "encoding/json" + "fmt" + "io" + "io/ioutil" + "net/http" + "strings" + + "github.com/Rhymen/go-whatsapp" +) + +const ( + OldUserSuffix = "@c.us" + NewUserSuffix = "@s.whatsapp.net" +) + +type ExtendedConn struct { + *whatsapp.Conn + + handlers []whatsapp.Handler +} + +func ExtendConn(conn *whatsapp.Conn) *ExtendedConn { + ext := &ExtendedConn{ + Conn: conn, + } + ext.Conn.AddHandler(ext) + return ext +} + +type GroupInfo struct { + JID string `json:"jid"` + OwnerJID string `json:"owner"` + + Name string `json:"subject"` + NameSetTime int64 `json:"subjectTime"` + NameSetBy string `json:"subjectOwner"` + + Topic string `json:"desc"` + TopicID string `json:"descId"` + TopicSetAt int64 `json:"descTime"` + TopicSetBy string `json:"descOwner"` + + GroupCreated int64 `json:"creation"` + + Status int16 `json:"status"` + + Participants []struct { + JID string `json:"id"` + IsAdmin bool `json:"isAdmin"` + IsSuperAdmin bool `json:"isSuperAdmin"` + } `json:"participants"` +} + +func (ext *ExtendedConn) GetGroupMetaData(jid string) (*GroupInfo, error) { + data, err := ext.Conn.GetGroupMetaData(jid) + if err != nil { + return nil, fmt.Errorf("failed to get group metadata: %v", err) + } + content := <-data + + info := &GroupInfo{} + err = json.Unmarshal([]byte(content), info) + if err != nil { + return info, fmt.Errorf("failed to unmarshal group metadata: %v", err) + } + + for index, participant := range info.Participants { + info.Participants[index].JID = strings.Replace(participant.JID, OldUserSuffix, NewUserSuffix, 1) + } + info.NameSetBy = strings.Replace(info.NameSetBy, OldUserSuffix, NewUserSuffix, 1) + info.TopicSetBy = strings.Replace(info.TopicSetBy, OldUserSuffix, NewUserSuffix, 1) + + return info, nil +} + +type ProfilePicInfo struct { + URL string `json:"eurl"` + Tag string `json:"tag"` + + Status int16 `json:"status"` +} + +func (ppi *ProfilePicInfo) Download() (io.ReadCloser, error) { + resp, err := http.Get(ppi.URL) + if err != nil { + return nil, err + } + return resp.Body, nil +} + +func (ppi *ProfilePicInfo) DownloadBytes() ([]byte, error) { + body, err := ppi.Download() + if err != nil { + return nil, err + } + defer body.Close() + data, err := ioutil.ReadAll(body) + return data, err +} + +func (ext *ExtendedConn) GetProfilePicThumb(jid string) (*ProfilePicInfo, error) { + data, err := ext.Conn.GetProfilePicThumb(jid) + if err != nil { + return nil, fmt.Errorf("failed to get avatar: %v", err) + } + content := <-data + info := &ProfilePicInfo{} + err = json.Unmarshal([]byte(content), info) + if err != nil { + return info, fmt.Errorf("failed to unmarshal avatar info: %v", err) + } + return info, nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 9cb748d2..5f6c67cb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -15,6 +15,14 @@ github.com/Philipp15b/go-steam/protocol/gamecoordinator github.com/Philipp15b/go-steam/protocol/protobuf github.com/Philipp15b/go-steam/rwu github.com/Philipp15b/go-steam/socialcache +# github.com/Rhymen/go-whatsapp v0.0.2-0.20190325075644-cc2581bbf24d +github.com/Rhymen/go-whatsapp +github.com/Rhymen/go-whatsapp/binary +github.com/Rhymen/go-whatsapp/binary/proto +github.com/Rhymen/go-whatsapp/crypto/cbc +github.com/Rhymen/go-whatsapp/crypto/curve25519 +github.com/Rhymen/go-whatsapp/crypto/hkdf +github.com/Rhymen/go-whatsapp/binary/token # github.com/bwmarrin/discordgo v0.19.0 github.com/bwmarrin/discordgo # github.com/d5/tengo v1.20.0 @@ -40,7 +48,7 @@ github.com/dgrijalva/jwt-go github.com/fsnotify/fsnotify # github.com/go-telegram-bot-api/telegram-bot-api v4.6.5-0.20181225215658-ec221ba9ea45+incompatible github.com/go-telegram-bot-api/telegram-bot-api -# github.com/golang/protobuf v1.2.0 +# github.com/golang/protobuf v1.3.0 github.com/golang/protobuf/proto github.com/golang/protobuf/protoc-gen-go/descriptor # github.com/google/gops v0.3.5 @@ -89,14 +97,6 @@ github.com/magiconair/properties github.com/matterbridge/Rocket.Chat.Go.SDK/models github.com/matterbridge/Rocket.Chat.Go.SDK/realtime github.com/matterbridge/Rocket.Chat.Go.SDK/rest -# github.com/matterbridge/go-whatsapp v0.0.1-0.20190301204034-f2f1b29d441b -github.com/matterbridge/go-whatsapp -github.com/matterbridge/go-whatsapp/binary -github.com/matterbridge/go-whatsapp/binary/proto -github.com/matterbridge/go-whatsapp/crypto/cbc -github.com/matterbridge/go-whatsapp/crypto/curve25519 -github.com/matterbridge/go-whatsapp/crypto/hkdf -github.com/matterbridge/go-whatsapp/binary/token # github.com/matterbridge/go-xmpp v0.0.0-20180529212104-cd19799fba91 github.com/matterbridge/go-xmpp # github.com/matterbridge/gomatrix v0.0.0-20190102230110-6f9631ca6dea @@ -105,8 +105,6 @@ github.com/matterbridge/gomatrix github.com/matterbridge/gozulipbot # github.com/matterbridge/logrus-prefixed-formatter v0.0.0-20180806162718-01618749af61 github.com/matterbridge/logrus-prefixed-formatter -# github.com/matterbridge/mautrix-whatsapp v0.0.0-20190301210046-3539cf52ed6e -github.com/matterbridge/mautrix-whatsapp/whatsapp-ext # github.com/mattermost/mattermost-server v5.5.0+incompatible github.com/mattermost/mattermost-server/model github.com/mattermost/mattermost-server/mlog @@ -143,7 +141,7 @@ github.com/pborman/uuid github.com/pelletier/go-toml # github.com/peterhellberg/emojilib v0.0.0-20190124112554-c18758d55320 github.com/peterhellberg/emojilib -# github.com/pkg/errors v0.8.0 +# github.com/pkg/errors v0.8.1 github.com/pkg/errors # github.com/pmezard/go-difflib v1.0.0 github.com/pmezard/go-difflib/difflib @@ -208,7 +206,7 @@ go.uber.org/zap/internal/bufferpool go.uber.org/zap/buffer go.uber.org/zap/internal/color go.uber.org/zap/internal/exit -# golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f +# golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 golang.org/x/crypto/ssh/terminal golang.org/x/crypto/acme/autocert golang.org/x/crypto/nacl/secretbox @@ -234,6 +232,7 @@ golang.org/x/net/websocket # golang.org/x/sys v0.0.0-20190222171317-cd391775e71e golang.org/x/sys/unix golang.org/x/sys/windows +golang.org/x/sys/cpu # golang.org/x/text v0.3.0 golang.org/x/text/encoding golang.org/x/text/encoding/japanese @@ -249,3 +248,5 @@ golang.org/x/text/encoding/internal gopkg.in/natefinch/lumberjack.v2 # gopkg.in/yaml.v2 v2.2.2 gopkg.in/yaml.v2 +# maunium.net/go/mautrix-whatsapp v0.0.0-20190406194125-7e1028726f0f +maunium.net/go/mautrix-whatsapp/whatsapp-ext -- cgit v1.2.3