mirror of
https://github.com/muesli/telephant
synced 2025-02-17 03:58:25 +00:00
Support media attachments in Mastodon account
This commit is contained in:
parent
dce3526e49
commit
5d99470415
1 changed files with 12 additions and 0 deletions
|
@ -161,6 +161,10 @@ func (mod *Account) handleStreamEvent(item interface{}) {
|
|||
URL: status.Notification.Status.URL,
|
||||
},
|
||||
}
|
||||
|
||||
for _, v := range status.Notification.Status.MediaAttachments {
|
||||
ev.Media = append(ev.Media, v.PreviewURL)
|
||||
}
|
||||
}
|
||||
|
||||
switch status.Notification.Type {
|
||||
|
@ -213,9 +217,17 @@ func (mod *Account) handleStreamEvent(item interface{}) {
|
|||
},
|
||||
}
|
||||
|
||||
for _, v := range status.Status.MediaAttachments {
|
||||
ev.Media = append(ev.Media, v.PreviewURL)
|
||||
}
|
||||
|
||||
if status.Status.Reblog != nil {
|
||||
ev.Forward = true
|
||||
|
||||
for _, v := range status.Status.Reblog.MediaAttachments {
|
||||
ev.Media = append(ev.Media, v.PreviewURL)
|
||||
}
|
||||
|
||||
ev.Post.URL = status.Status.Reblog.URL
|
||||
ev.Post.Author = status.Status.Reblog.Account.DisplayName
|
||||
ev.Post.AuthorName = status.Status.Reblog.Account.Username
|
||||
|
|
Loading…
Add table
Reference in a new issue