Fix typo and add TODO

This commit is contained in:
Mark Haines 2017-02-06 18:18:26 +00:00
parent 9d0b3dc0ee
commit 68a212f5ef
2 changed files with 2 additions and 1 deletions

View file

@ -23,6 +23,7 @@ const (
)
// InputRoomEvent is a matrix room event to add to the room server database.
// TODO: Implement UnmarshalJSON/MarshalJSON in a way that does something sensible with the event JSON.
type InputRoomEvent struct {
// Whether this event is new, backfilled or an outlier.
// This controls how the event is processed.

View file

@ -91,7 +91,7 @@ func (c *Consumer) consumePartition(pc sarama.PartitionConsumer) {
defer pc.Close()
for message := range pc.Messages() {
var input api.InputRoomEvent
if err := json.Unmarshal(message.Value, &message.Value); err != nil {
if err := json.Unmarshal(message.Value, &input); err != nil {
c.logError(message, err)
} else {
if err := processRoomEvent(c.DB, input); err != nil {