Activity page shows create events only
This commit is contained in:
@ -28,7 +28,7 @@ func fetchActivities(user *arn.User, followedOnly bool) []arn.Activity {
|
||||
followedUserIDs = user.Follows().Items
|
||||
}
|
||||
|
||||
activities := arn.FilterActivities(func(activity arn.Activity) bool {
|
||||
activities := arn.FilterActivityCreates(func(activity arn.Activity) bool {
|
||||
if followedOnly && !arn.Contains(followedUserIDs, activity.GetCreatedBy()) {
|
||||
return false
|
||||
}
|
||||
@ -37,22 +37,14 @@ func fetchActivities(user *arn.User, followedOnly bool) []arn.Activity {
|
||||
return false
|
||||
}
|
||||
|
||||
if activity.TypeName() == "ActivityCreate" {
|
||||
obj := activity.(*arn.ActivityCreate).Object()
|
||||
obj := activity.(*arn.ActivityCreate).Object()
|
||||
|
||||
if obj == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
draft, isDraftable := obj.(arn.Draftable)
|
||||
return !isDraftable || !draft.GetIsDraft()
|
||||
if obj == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if activity.TypeName() == "ActivityConsumeAnime" {
|
||||
return activity.(*arn.ActivityConsumeAnime).Anime() != nil
|
||||
}
|
||||
|
||||
return false
|
||||
draft, isDraftable := obj.(arn.Draftable)
|
||||
return !isDraftable || !draft.GetIsDraft()
|
||||
})
|
||||
|
||||
arn.SortActivitiesLatestFirst(activities)
|
||||
|
@ -66,13 +66,15 @@ component ActivityConsumeAnimeText(activity *arn.ActivityConsumeAnime, user *arn
|
||||
span= fmt.Sprintf(" episode %d.", activity.ToEpisode)
|
||||
|
||||
component ActivityCreateMeta(activity *arn.ActivityCreate, user *arn.User)
|
||||
span in
|
||||
|
||||
if activity.ObjectType == "Post"
|
||||
a(href=activity.Postable().Parent().Link())= activity.Postable().Parent().TitleByUser(user)
|
||||
if activity.Postable().GetParentType() != "User" || activity.Postable().GetParentID() != activity.CreatedBy
|
||||
span in
|
||||
a(href=activity.Postable().Parent().Link())= activity.Postable().Parent().TitleByUser(user)
|
||||
else if activity.ObjectType == "Thread"
|
||||
span in
|
||||
a(href=activity.Postable().Link())= activity.Postable().TitleByUser(user)
|
||||
else if activity.ObjectType == "AMV" || activity.ObjectType == "SoundTrack" || activity.ObjectType == "Quote"
|
||||
span in
|
||||
a(href=activity.Object().(arn.PostParent).Link())= activity.Object().(arn.PostParent).TitleByUser(user)
|
||||
|
||||
component ActivityCreateText(activity *arn.ActivityCreate, user *arn.User)
|
||||
|
Reference in New Issue
Block a user