瀏覽代碼

Fix some things

Tulir Asokan 3 年之前
父節點
當前提交
04ab823a4d
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 2 2
      commands.go
  2. 3 3
      portal.go

+ 2 - 2
commands.go

@@ -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 {

+ 3 - 3
portal.go

@@ -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
 			}