2016-04-13 09:14:23 +03:00
|
|
|
package messenger
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
type Message struct {
|
2016-04-13 12:46:52 +03:00
|
|
|
Sender Sender `json:"-"`
|
|
|
|
Recipient Recipient `json:"-"`
|
|
|
|
Time time.Time `json:"-"`
|
|
|
|
Mid string `json:"mid"`
|
|
|
|
Text string `json:"text"`
|
|
|
|
Seq int `json:"seq"`
|
|
|
|
Attachments []Attachment `json:"attachments"`
|
2016-04-13 12:12:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type Delivery struct {
|
2016-04-13 12:36:38 +03:00
|
|
|
Mids []string `json:"mids"`
|
|
|
|
RawWatermark int64 `json:"watermark"`
|
|
|
|
Seq int `json:"seq"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d Delivery) Watermark() time.Time {
|
|
|
|
return time.Unix(d.RawWatermark, 0)
|
2016-04-13 09:14:23 +03:00
|
|
|
}
|