mirror of
https://github.com/muesli/telephant
synced 2024-11-26 05:10:18 +00:00
Support delete events from Mastodon
This commit is contained in:
parent
0487a7bd15
commit
073406a234
3 changed files with 16 additions and 0 deletions
|
@ -84,6 +84,10 @@ type LoginEvent struct {
|
|||
PostSizeLimit int64
|
||||
}
|
||||
|
||||
type DeleteEvent struct {
|
||||
ID string
|
||||
}
|
||||
|
||||
// ErrorEvent describes an error that occurred.
|
||||
type ErrorEvent struct {
|
||||
Message string
|
||||
|
|
|
@ -644,6 +644,14 @@ func (mod *Account) handleStreamEvent(item interface{}, ch chan interface{}) {
|
|||
|
||||
case *mastodon.UpdateEvent:
|
||||
ch <- mod.handleStatus(e.Status)
|
||||
|
||||
case *mastodon.DeleteEvent:
|
||||
mod.evchan <- accounts.DeleteEvent{
|
||||
ID: string(e.ID),
|
||||
}
|
||||
|
||||
default:
|
||||
fmt.Printf("Unknown event: %+v\n", item)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,10 @@ func handleEvents(eventsIn chan interface{}, messages *MessageModel) {
|
|||
p.Preview = event.Preview
|
||||
attachmentModel.AddAttachment(p)
|
||||
}
|
||||
case accounts.DeleteEvent:
|
||||
{
|
||||
deleteMessage(event.ID)
|
||||
}
|
||||
case accounts.MessageEvent:
|
||||
{
|
||||
// spw := &spew.ConfigState{Indent: " ", DisableCapacities: true, DisablePointerAddresses: true}
|
||||
|
|
Loading…
Reference in a new issue