Skip to content

Commit fbd796b

Browse files
committed
fix: make connect tab more reliable (fixes: #66)
1 parent bcd38ad commit fbd796b

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

bluesky/blueskyapi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1960,7 +1960,7 @@ func GetOthersSuggestedUsers(pds string, token string, limit int, actor string)
19601960
func GetNotifications(pds string, token string, limit int, context string) (*Notifications, error) {
19611961
url := pds + "/xrpc/app.bsky.notification.listNotifications?limit=" + fmt.Sprintf("%d", limit)
19621962
if context != "" {
1963-
url = pds + "/xrpc/app.bsky.notification.listNotifications?cursor=" + context + "&limit=" + fmt.Sprintf("%d", limit)
1963+
url = pds + "/xrpc/app.bsky.notification.listNotifications?reasons=mention&reasons=reply&reasons=quote&reasons=like&reasons=repost&reasons=follow&cursor=" + context + "&limit=" + fmt.Sprintf("%d", limit)
19641964
}
19651965

19661966
resp, err := SendRequest(&token, http.MethodGet, url, nil)

twitterv1/connect.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func GetMyActivity(c *fiber.Ctx) error {
192192
if notification.ReasonSubject != "" {
193193
uniquePosts[notification.ReasonSubject] = true
194194
}
195-
if notification.Reason == "mention" || notification.Reason == "reply" {
195+
if notification.Reason == "mention" || notification.Reason == "reply" || notification.Reason == "quote" {
196196
uniquePosts[notification.URI] = true
197197
}
198198
}
@@ -372,11 +372,15 @@ func processNotificationGroup(group notificationGroup, userCache *sync.Map, post
372372
activity.Targets = []bridge.Tweet{*replytweet}
373373
activity.TargetObjects = []bridge.Tweet{*tweet}
374374
}
375+
case "quote":
376+
if quotingPost, ok := postCache.Load(group.notifications[0].URI); ok {
377+
activity.TargetObjects = append(activity.TargetObjects, *(quotingPost.(*bridge.Tweet)))
378+
}
375379
}
376380
}
377381
} else {
378382
switch group.reason {
379-
case "mention", "quote":
383+
case "mention":
380384
if post, ok := postCache.Load(group.notifications[0].URI); ok {
381385
tweet := post.(*bridge.Tweet)
382386
activity.Sources = []bridge.TwitterUser{}

twitterv1/twitterv1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func InitServer(config *config.Config) {
173173
// Push Notifications
174174
AddV1Path(app.Get, "/account/push_destinations/device.:filetype", DevicePushDestinations)
175175
AddV1Path(app.Post, "/account/push_destinations.:filetype", UpdatePushNotifications)
176-
AddV1Path(app.Get, "/account/push_destinations/destroy.:filetype", RemovePush)
176+
AddV1Path(app.Post, "/account/push_destinations/destroy.:filetype", RemovePush)
177177

178178
// Legal cuz why not?
179179
AddV1Path(app.Get, "/legal/tos.:filetype", TOS)

0 commit comments

Comments
 (0)