summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/Rhymen/go-whatsapp/message.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/Rhymen/go-whatsapp/message.go')
-rw-r--r--vendor/github.com/Rhymen/go-whatsapp/message.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/github.com/Rhymen/go-whatsapp/message.go b/vendor/github.com/Rhymen/go-whatsapp/message.go
index d4bc0926..15797cb4 100644
--- a/vendor/github.com/Rhymen/go-whatsapp/message.go
+++ b/vendor/github.com/Rhymen/go-whatsapp/message.go
@@ -867,11 +867,21 @@ func getBatteryMessage(msg map[string]string) BatteryMessage {
return batteryMessage
}
+func getNewContact(msg map[string]string) Contact {
+ contact := Contact{
+ Jid: msg["jid"],
+ Notify: msg["notify"],
+ }
+
+ return contact
+}
func ParseNodeMessage(msg binary.Node) interface{} {
switch msg.Description {
case "battery":
return getBatteryMessage(msg.Attributes)
+ case "user":
+ return getNewContact(msg.Attributes)
default:
//cannot match message
}