fingerprint
This commit is contained in:
parent
a31c20b173
commit
7e231be804
|
|
@ -24,8 +24,14 @@ func NewMessage(addreess string, token string, sender string) *Message {
|
|||
}
|
||||
}
|
||||
|
||||
func (m *Message) Send(receiver, content string) error {
|
||||
reqUrl := fmt.Sprintf("%s/admin/message/send?sender=%s&receiver=%s&content=%s", m.address, m.sender, receiver, url.QueryEscape(content))
|
||||
func (m *Message) Send(args ...string) error {
|
||||
var receiver, content, fingerprint string
|
||||
if len(args) == 2 {
|
||||
receiver, content = args[0], args[1]
|
||||
} else if len(args) > 2 {
|
||||
receiver, content, fingerprint = args[0], args[1], args[2]
|
||||
}
|
||||
reqUrl := fmt.Sprintf("%s/admin/message/send?sender=%s&receiver=%s&fingerprint=%s&content=%s", m.address, m.sender, receiver, fingerprint, url.QueryEscape(content))
|
||||
body, err := util.HttpGet(reqUrl, map[string]string{
|
||||
"x-token": m.token,
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue