https://web.archive.org/web/20120407201029/https://dev.twitter.com/docs/api/1/post/friendships/create
(c *fiber.Ctx, actor string)
| 349 | |
| 350 | // https://web.archive.org/web/20120407201029/https://dev.twitter.com/docs/api/1/post/friendships/create |
| 351 | func UnfollowUser(c *fiber.Ctx, actor string) error { |
| 352 | // auth |
| 353 | my_did, pds, _, oauthToken, err := GetAuthFromReq(c) |
| 354 | if err != nil { |
| 355 | return MissingAuth(c, err) |
| 356 | } |
| 357 | |
| 358 | // follow |
| 359 | user, err := blueskyapi.UnfollowUser(*pds, *oauthToken, actor, *my_did) |
| 360 | |
| 361 | if err != nil { |
| 362 | fmt.Println("Error:", err) |
| 363 | return HandleBlueskyError(c, err.Error(), "app.bsky.graph.unfollow", func(c *fiber.Ctx) error { |
| 364 | return UnfollowUser(c, actor) |
| 365 | }) |
| 366 | } |
| 367 | |
| 368 | // convert user into twitter format |
| 369 | twitterUser := blueskyapi.AuthorTTB(*user) |
| 370 | |
| 371 | return EncodeAndSend(c, twitterUser) |
| 372 | } |
| 373 | |
| 374 | func UnfollowUserForm(c *fiber.Ctx) error { |
| 375 | // lets get the user params |
no test coverage detected