Replaced Username with proper Account name, which includes the instance

This commit is contained in:
Christian Muehlhaeuser 2019-05-02 13:33:18 +02:00
parent f0df5dab88
commit 00667e8dc9
No known key found for this signature in database
GPG key ID: 3CF9FA45CA1EBB7E

View file

@ -157,8 +157,8 @@ func (mod *Account) handleStreamEvent(item interface{}) {
Post: accounts.Post{
MessageID: string(status.Notification.Status.ID),
Body: status.Notification.Status.Content,
Author: status.Notification.Account.DisplayName,
AuthorName: status.Notification.Account.Username,
Author: status.Notification.Account.Username,
AuthorName: status.Notification.Account.DisplayName,
AuthorURL: status.Notification.Account.URL,
Avatar: status.Notification.Account.Avatar,
CreatedAt: time.Now(),
@ -181,22 +181,22 @@ func (mod *Account) handleStreamEvent(item interface{}) {
case "reblog":
ev.Forward = true
ev.Post.Author = status.Notification.Status.Account.DisplayName
ev.Post.AuthorName = status.Notification.Status.Account.Username
ev.Post.Author = status.Notification.Status.Account.Username
ev.Post.AuthorName = status.Notification.Status.Account.DisplayName
ev.Post.AuthorURL = status.Notification.Status.Account.URL
// ev.Post.Avatar = status.Notification.Status.Account.Avatar
ev.Post.Actor = status.Notification.Account.DisplayName
ev.Post.ActorName = status.Notification.Account.Username
ev.Post.Actor = status.Notification.Account.Username
ev.Post.ActorName = status.Notification.Account.DisplayName
case "favourite":
ev.Like = true
ev.Post.Author = status.Notification.Status.Account.DisplayName
ev.Post.AuthorName = status.Notification.Status.Account.Username
ev.Post.Author = status.Notification.Status.Account.Username
ev.Post.AuthorName = status.Notification.Status.Account.DisplayName
ev.Post.AuthorURL = status.Notification.Status.Account.URL
// ev.Post.Avatar = status.Notification.Status.Account.Avatar
ev.Post.Actor = status.Notification.Account.DisplayName
ev.Post.ActorName = status.Notification.Account.Username
ev.Post.Actor = status.Notification.Account.Username
ev.Post.ActorName = status.Notification.Account.DisplayName
default:
fmt.Println("Unknown type:", status.Notification.Type)
@ -212,8 +212,8 @@ func (mod *Account) handleStreamEvent(item interface{}) {
Post: accounts.Post{
MessageID: string(status.Status.ID),
Body: status.Status.Content,
Author: status.Status.Account.DisplayName,
AuthorName: status.Status.Account.Username,
Author: status.Status.Account.Acct,
AuthorName: status.Status.Account.DisplayName,
AuthorURL: status.Status.Account.URL,
Avatar: status.Status.Account.Avatar,
CreatedAt: time.Now(),
@ -233,8 +233,8 @@ func (mod *Account) handleStreamEvent(item interface{}) {
}
ev.Post.URL = status.Status.Reblog.URL
ev.Post.Author = status.Status.Reblog.Account.DisplayName
ev.Post.AuthorName = status.Status.Reblog.Account.Username
ev.Post.Author = status.Status.Reblog.Account.Username
ev.Post.AuthorName = status.Status.Reblog.Account.DisplayName
ev.Post.AuthorURL = status.Status.Reblog.Account.URL
ev.Post.Actor = status.Status.Account.DisplayName
ev.Post.ActorName = status.Status.Account.Username