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.go17
1 files changed, 7 insertions, 10 deletions
diff --git a/vendor/github.com/Rhymen/go-whatsapp/message.go b/vendor/github.com/Rhymen/go-whatsapp/message.go
index 15797cb4..34fc02af 100644
--- a/vendor/github.com/Rhymen/go-whatsapp/message.go
+++ b/vendor/github.com/Rhymen/go-whatsapp/message.go
@@ -238,7 +238,7 @@ func getMessageInfo(msg *proto.WebMessageInfo) MessageInfo {
return MessageInfo{
Id: msg.GetKey().GetId(),
RemoteJid: msg.GetKey().GetRemoteJid(),
- SenderJid: msg.GetKey().GetParticipant(),
+ SenderJid: msg.GetParticipant(),
FromMe: msg.GetKey().GetFromMe(),
Timestamp: msg.GetMessageTimestamp(),
Status: MessageStatus(msg.GetStatus()),
@@ -838,19 +838,16 @@ func ParseProtoMessage(msg *proto.WebMessageInfo) interface{} {
default:
//cannot match message
-
+ return ErrMessageTypeNotImplemented
}
-
- return nil
}
-
/*
BatteryMessage represents a battery level and charging state.
*/
type BatteryMessage struct {
- Plugged bool
- Powersave bool
+ Plugged bool
+ Powersave bool
Percentage int
}
@@ -859,8 +856,8 @@ func getBatteryMessage(msg map[string]string) BatteryMessage {
powersave, _ := strconv.ParseBool(msg["powersave"])
percentage, _ := strconv.Atoi(msg["value"])
batteryMessage := BatteryMessage{
- Plugged: plugged,
- Powersave: powersave,
+ Plugged: plugged,
+ Powersave: powersave,
Percentage: percentage,
}
@@ -869,7 +866,7 @@ func getBatteryMessage(msg map[string]string) BatteryMessage {
func getNewContact(msg map[string]string) Contact {
contact := Contact{
- Jid: msg["jid"],
+ Jid: msg["jid"],
Notify: msg["notify"],
}