MCPcopy Create free account
hub / github.com/daodst/chat / PerformPusherDeletion

Method PerformPusherDeletion

userapi/internal/api.go:731–746  ·  view source on GitHub ↗
(ctx context.Context, req *api.PerformPusherDeletionRequest, res *struct{})

Source from the content-addressed store, hash-verified

729}
730
731func (a *UserInternalAPI) PerformPusherDeletion(ctx context.Context, req *api.PerformPusherDeletionRequest, res *struct{}) error {
732 pushers, err := a.DB.GetPushers(ctx, req.Localpart)
733 if err != nil {
734 return err
735 }
736 for i := range pushers {
737 logrus.Warnf("pusher session: %d, req session: %d", pushers[i].SessionID, req.SessionID)
738 if pushers[i].SessionID != req.SessionID {
739 err := a.DB.RemovePusher(ctx, pushers[i].AppID, pushers[i].PushKey, req.Localpart)
740 if err != nil {
741 return err
742 }
743 }
744 }
745 return nil
746}
747
748func (a *UserInternalAPI) QueryPushers(ctx context.Context, req *api.QueryPushersRequest, res *api.QueryPushersResponse) error {
749 var err error

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected