Repair per-post topic history

Refactors in the topic moderation patch broke per-post topic history,
this brings back fixes most likely lost in a rebase.

Change-Id: Ice4a3a23b642ec527ee55edb5c937ac48fad13e6
Merge "Repair per-post topic history"