diff options
author | FChannel <> | 2021-07-15 15:24:39 -0700 |
---|---|---|
committer | FChannel <> | 2021-07-15 15:24:39 -0700 |
commit | a13a0d96f3808c17d9c50df1af400b73445f64ac (patch) | |
tree | 277e68f258ee7007571fdec62b8c19c3e521e14f | |
parent | e97c3e9d2d1bedf63a7d341eb199c9500bcd8cd9 (diff) |
when using /g/followers or /g/following also follow the board g
-rw-r--r-- | main.go | 16 | ||||
-rw-r--r-- | static/manage.html | 7 |
2 files changed, 18 insertions, 5 deletions
@@ -484,8 +484,14 @@ func main() { if following.MatchString(follow) { followingActor := FingerActor(follow) col := GetActorCollection(followingActor.Following) + + var nObj ObjectBase + nObj.Id = followingActor.Id + + col.Items = append(col.Items, nObj) + for _, e := range col.Items { - if !IsAlreadyFollowing(db, actorId, e.Id) && e.Id != Domain { + if !IsAlreadyFollowing(db, actorId, e.Id) && e.Id != Domain && e.Id != actorId { followActivity := MakeFollowActivity(db, actorId, e.Id) if FingerActor(e.Id).Id != "" { @@ -498,8 +504,14 @@ func main() { } else if followers.MatchString(follow){ followersActor := FingerActor(follow) col := GetActorCollection(followersActor.Followers) + + var nObj ObjectBase + nObj.Id = followersActor.Id + + col.Items = append(col.Items, nObj) + for _, e := range col.Items { - if !IsAlreadyFollowing(db, actorId, e.Id) && e.Id != Domain { + if !IsAlreadyFollowing(db, actorId, e.Id) && e.Id != Domain && e.Id != actorId { followActivity := MakeFollowActivity(db, actorId, e.Id) if FingerActor(e.Id).Id != "" { MakeActivityRequestOutbox(db, followActivity) diff --git a/static/manage.html b/static/manage.html index a9dc47e..2647532 100644 --- a/static/manage.html +++ b/static/manage.html @@ -22,12 +22,13 @@ {{ if .IsLocal }} <div id="following" class="popup-box" style="margin-bottom: 25px; margin-top: 5px; padding: 12px;"> <h4 style="margin: 0; margin-bottom: 5px;">Following</h4> - <a href="/autosubscribe?board={{ .Board.Name }}">{{ if .AutoSubscribe }}[Auto Subscribe On]{{ else }}[Auto Subscribe Off]{{ end }}</a> + <a href="/autosubscribe?board={{ .Board.Name }}">{{ if .AutoSubscribe }}[Auto Follow On]{{ else }}[Auto Follow Off]{{ end }}</a> <form id="follow-form" action="/{{ .Key }}/{{ .Board.Name }}/follow" method="post" enctype="application/x-www-form-urlencoded" style="margin-top: 5px;"> - <input id="follow" name="follow" style="margin-bottom: 12px;" placeholder="https://fchan.xyz/g"></input> + <input id="follow" name="follow" style="margin-bottom: 5px;" size="35" placeholder="https://fchan.xyz/g"></input> <input type="submit" value="Follow"><br> <input type="hidden" name="actor" value="{{ $board.Actor.Id }}"> - </form> + </form> + <div style="margin-bottom: 12px; color: grey;">also https://fchan.xyz/g/following or https://fchan.xyz/g/followers</div> <ul style="display: inline-block; padding: 0; margin: 0; list-style-type: none;"> {{ range .Following }} <li><a href="/{{ $key }}/{{ $board.Name }}/follow?follow={{ . }}&actor={{ $actor }}">[Unsubscribe]</a><a href="{{ . }}">{{ . }}</a></li> |