Преглед изворни кода

Remove unused variable and fix formatting

Tulir Asokan пре 3 година
родитељ
комит
19104d857b
2 измењених фајлова са 8 додато и 9 уклоњено
  1. 1 2
      historysync.go
  2. 7 7
      portal.go

+ 1 - 2
historysync.go

@@ -382,9 +382,8 @@ func (portal *Portal) backfill(source *User, messages []*waProto.WebMessageInfo)
 		}
 		var batch *mautrix.ReqBatchSend
 		var infos *[]*types.MessageInfo
-		var history bool
 		if !historyMaxTs.IsZero() && info.Timestamp.Before(historyMaxTs) {
-			batch, infos, history = &historyBatch, &historyBatchInfos, true
+			batch, infos = &historyBatch, &historyBatchInfos
 		} else if !newMinTs.IsZero() && info.Timestamp.After(newMinTs) {
 			batch, infos = &newBatch, &newBatchInfos
 		} else {

+ 7 - 7
portal.go

@@ -1331,8 +1331,8 @@ func (portal *Portal) convertLocationMessage(intent *appservice.IntentAPI, msg *
 	}
 
 	return &ConvertedMessage{
-		Intent: intent,
-		Type: event.EventMessage,
+		Intent:  intent,
+		Type:    event.EventMessage,
 		Content: content,
 		ReplyTo: msg.GetContextInfo().GetStanzaId(),
 	}
@@ -1359,10 +1359,10 @@ func (portal *Portal) convertGroupInviteMessage(intent *appservice.IntentAPI, in
 		},
 	}
 	return &ConvertedMessage{
-		Intent: intent,
-		Type: event.EventMessage,
+		Intent:  intent,
+		Type:    event.EventMessage,
 		Content: content,
-		Extra: extraAttrs,
+		Extra:   extraAttrs,
 		ReplyTo: msg.GetContextInfo().GetStanzaId(),
 	}
 }
@@ -1395,8 +1395,8 @@ func (portal *Portal) convertContactMessage(intent *appservice.IntentAPI, msg *w
 	}
 
 	return &ConvertedMessage{
-		Intent: intent,
-		Type: event.EventMessage,
+		Intent:  intent,
+		Type:    event.EventMessage,
 		Content: content,
 		ReplyTo: msg.GetContextInfo().GetStanzaId(),
 	}