this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

a few more renaming variables

+6 -6
+2 -2
consumer.go
··· 154 154 return nil 155 155 } 156 156 157 - func (h *handler) addDidToSubscribedPost(subscribedPostURI, userDid, rkey string) error { 158 - err := h.store.AddSubscriptionForPost(subscribedPostURI, userDid, rkey) 157 + func (h *handler) addDidToSubscribedPost(subscribedPostURI, userDid, subscriptionPostRkey string) error { 158 + err := h.store.AddSubscriptionForPost(subscribedPostURI, userDid, subscriptionPostRkey) 159 159 if err != nil { 160 160 return fmt.Errorf("add subscription for post: %w", err) 161 161 }
+4 -4
store/subscription.go
··· 56 56 return dids, nil 57 57 } 58 58 59 - func (s *Store) AddSubscriptionForPost(subscribedPostURI, userDid, subscriptionRkey string) error { 59 + func (s *Store) AddSubscriptionForPost(subscribedPostURI, userDid, subscriptionPostRkey string) error { 60 60 sql := `INSERT INTO subscriptions (subscribedPostURI, userDID, subscriptionPostRkey) VALUES (?, ?, ?) ON CONFLICT(subscribedPostURI, userDID) DO NOTHING;` 61 - _, err := s.db.Exec(sql, subscribedPostURI, userDid, subscriptionRkey) 61 + _, err := s.db.Exec(sql, subscribedPostURI, userDid, subscriptionPostRkey) 62 62 if err != nil { 63 63 return fmt.Errorf("exec insert subscrptions: %w", err) 64 64 } 65 65 return nil 66 66 } 67 67 68 - func (s *Store) GetSubscribedPostURI(userDID, rkey string) (string, error) { 68 + func (s *Store) GetSubscribedPostURI(userDID, subscriptionPostRkey string) (string, error) { 69 69 sql := "SELECT id, subscribedPostURI FROM subscriptions WHERE subscriptionPostRkey = ? AND userDID = ?;" 70 - rows, err := s.db.Query(sql, rkey, userDID) 70 + rows, err := s.db.Query(sql, subscriptionPostRkey, userDID) 71 71 if err != nil { 72 72 return "", fmt.Errorf("run query to get subscribed post URI: %w", err) 73 73 }