Fix some things

This commit is contained in:
Tulir Asokan 2021-11-30 15:27:15 +02:00
parent 231691ebbd
commit 04ab823a4d
2 changed files with 5 additions and 5 deletions

View file

@ -963,10 +963,10 @@ func (handler *CommandHandler) CommandSearch(ce *CommandEvent) {
result := make([]string, 0, 2)
if len(formattedContacts) > 0 {
result = append(result, "### Contacts\n\n" + formattedContacts)
result = append(result, "### Contacts\n\n"+formattedContacts)
}
if len(formattedGroups) > 0 {
result = append(result, "### Groups\n\n" + formattedGroups)
result = append(result, "### Groups\n\n"+formattedGroups)
}
if len(result) == 0 {

View file

@ -375,7 +375,7 @@ func (portal *Portal) handleFakeMessage(msg fakeMessage) {
Body: msg.Text,
}, nil, msg.Time.UnixMilli())
if err != nil {
portal.log.Errorln("Failed to send %s to Matrix: %v", msg.ID, err)
portal.log.Errorfln("Failed to send %s to Matrix: %v", msg.ID, err)
} else {
portal.finishHandling(nil, &types.MessageInfo{
ID: msg.ID,
@ -425,7 +425,7 @@ func (portal *Portal) handleMessage(source *User, evt *events.Message) {
}
resp, err := portal.sendMessage(converted.Intent, converted.Type, converted.Content, converted.Extra, evt.Info.Timestamp.UnixMilli())
if err != nil {
portal.log.Errorln("Failed to send %s to Matrix: %v", msgID, err)
portal.log.Errorfln("Failed to send %s to Matrix: %v", msgID, err)
} else {
eventID = resp.EventID
}
@ -433,7 +433,7 @@ func (portal *Portal) handleMessage(source *User, evt *events.Message) {
if converted.Caption != nil && existingMsg == nil {
resp, err = portal.sendMessage(converted.Intent, converted.Type, converted.Caption, nil, evt.Info.Timestamp.UnixMilli())
if err != nil {
portal.log.Errorln("Failed to send caption of %s to Matrix: %v", msgID, err)
portal.log.Errorfln("Failed to send caption of %s to Matrix: %v", msgID, err)
} else {
eventID = resp.EventID
}