1
0
Fork 0
mirror of https://github.com/Luzifer/runemetrics.git synced 2024-12-22 12:11:20 +00:00

Retain older activity messages

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-09-07 18:16:14 +02:00
parent e0c5fd789b
commit 15d54ac1fd
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -127,6 +127,26 @@ func getPlayerInfo(name string, activities int) (*playerInfo, error) {
out.SkillValues[i].Updated = time.Now() out.SkillValues[i].Updated = time.Now()
} }
var (
lastActivity = out.Activities[len(out.Activities)-1]
skip = true
)
for _, a := range playerInfoCache.Activities {
// Times are no good match: they might be duplicated, we search
// last message which should never duplicate.
if a.Details == lastActivity.Details {
skip = false
continue
}
if skip {
continue
}
out.Activities = append(out.Activities, a)
}
} }
if knownTotalXP != out.TotalXP { if knownTotalXP != out.TotalXP {