parent
135adaab04
commit
255554db97
@ -1,9 +1,37 @@ |
||||
package feta |
||||
|
||||
import "encoding/json" |
||||
|
||||
type toot struct { |
||||
original *json.RawMessage |
||||
parsed *tootFromAPI |
||||
} |
||||
|
||||
func newToots(input []*json.RawMessage) []*toot { |
||||
l := make([]*toot, 0) |
||||
for x := range input { |
||||
t := newToot(x) |
||||
if t != nil { |
||||
l = append(l, t) |
||||
} |
||||
} |
||||
return l |
||||
} |
||||
|
||||
func newToot(input []byte) *toot { |
||||
func newToot(input *json.RawMessage) *toot { |
||||
t := new(toot) |
||||
t.original = input |
||||
t.parsed = new(tootFromAPI) |
||||
err = json.Unmarshal(*input, t.parsed) |
||||
if err != nil { |
||||
t.parsed = nil |
||||
} |
||||
return t |
||||
} |
||||
|
||||
func (t *toot) identityHashInput() string { |
||||
// id + datestamp + acct + content
|
||||
} |
||||
|
||||
func (t *toot) hash() tootHash { |
||||
} |
||||
|
Loading…
Reference in new issue