Browse Source

internal/ipp: auto subscribe on login and follow

servusdei2018 1 week ago
committed by James Mills
parent
commit
1c96b2fdf3
Signed by: prologic GPG Key ID: AC4C014F1440EBD6
  1. 5
      internal/follow_handlers.go
  2. 2
      internal/interpod_protocol.go
  3. 5
      internal/login_handlers.go

5
internal/follow_handlers.go

@ -57,6 +57,11 @@ func (s *Server) FollowHandler() httprouter.Handle {
s.cache.GetByUser(ctx.User, true)
// Update user subscriptions.
if s.config.Features.IsEnabled(FeatureIPP) {
s.UpdateIPPSubscriptions(ctx.User)
}
ctx.Error = false
ctx.Message = s.tr(ctx, "MsgFollowUserSuccess", trdata)
s.render("error", w, ctx)

2
internal/interpod_protocol.go

@ -259,7 +259,7 @@ func (s *Server) SubscribeIPP(feeds types.Feeds) {
}
}
func (s *Server) UpdateIPPSubscritpions(user *User) {
func (s *Server) UpdateIPPSubscriptions(user *User) {
var matchingPeers Peers
// First get a list of peering Pods

5
internal/login_handlers.go

@ -91,6 +91,11 @@ func (s *Server) LoginHandler() httprouter.Handle {
_ = sess.(*session.Session).Set("persist", "1")
}
// Update user subscriptions.
if s.config.Features.IsEnabled(FeatureIPP) {
s.UpdateIPPSubscriptions(user)
}
http.Redirect(w, r, r.FormValue("referer"), http.StatusFound)
}
}

Loading…
Cancel
Save