mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-27 13:12:05 -08:00
golint happifying, round 2
This commit is contained in:
parent
14a83e08cb
commit
db453a186e
@ -3,9 +3,10 @@ package bsignald
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"net"
|
||||||
|
|
||||||
"github.com/42wim/matterbridge/bridge"
|
"github.com/42wim/matterbridge/bridge"
|
||||||
"github.com/42wim/matterbridge/bridge/config"
|
"github.com/42wim/matterbridge/bridge/config"
|
||||||
"net"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type JSONCMD map[string]interface{}
|
type JSONCMD map[string]interface{}
|
||||||
@ -79,7 +80,7 @@ type signaldDataMessage struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type signaldGroupInfo struct {
|
type signaldGroupInfo struct {
|
||||||
AvatarId int64 `json:"avatarId,omitempty"`
|
AvatarID int64 `json:"avatarId,omitempty"`
|
||||||
ID string `json:"groupId,omitempty"`
|
ID string `json:"groupId,omitempty"`
|
||||||
Members json.RawMessage `json:"members,omitempty"`
|
Members json.RawMessage `json:"members,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
@ -104,7 +105,7 @@ type signaldGroupV2Info struct {
|
|||||||
type signaldSendMessage struct {
|
type signaldSendMessage struct {
|
||||||
Type string `json:"type,omitempty"`
|
Type string `json:"type,omitempty"`
|
||||||
Username string `json:"username,omitempty"`
|
Username string `json:"username,omitempty"`
|
||||||
RecipientGroupId string `json:"recipientGroupId,omitempty"`
|
RecipientGroupID string `json:"recipientGroupId,omitempty"`
|
||||||
MessageBody string `json:"messageBody,omitempty"`
|
MessageBody string `json:"messageBody,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,7 +160,9 @@ func (b *Bsignald) Connect() error {
|
|||||||
r := bufio.NewScanner(s)
|
r := bufio.NewScanner(s)
|
||||||
b.reader = r
|
b.reader = r
|
||||||
go b.Listen()
|
go b.Listen()
|
||||||
go b.Login()
|
if err := b.Login(); err != nil {
|
||||||
|
b.Log.Errorln("Error logging in: ", err.Error())
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,7 +340,7 @@ func (b *Bsignald) Send(msg config.Message) (string, error) {
|
|||||||
msgJSON := signaldSendMessage{
|
msgJSON := signaldSendMessage{
|
||||||
Type: "send",
|
Type: "send",
|
||||||
Username: b.GetString(cfgNumber),
|
Username: b.GetString(cfgNumber),
|
||||||
RecipientGroupId: b.groupid,
|
RecipientGroupID: b.groupid,
|
||||||
MessageBody: msg.Username + msg.Text,
|
MessageBody: msg.Username + msg.Text,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user