MCPcopy Create free account
hub / github.com/Preloading/TwitterAPIBridge / UnfollowUserForm

Function UnfollowUserForm

twitterv1/user.go:374–397  ·  view source on GitHub ↗
(c *fiber.Ctx)

Source from the content-addressed store, hash-verified

372}
373
374func UnfollowUserForm(c *fiber.Ctx) error {
375 // lets get the user params
376 actor := c.FormValue("user_id")
377 if actor == "" {
378 actor = c.FormValue("screen_name")
379 if actor == "" {
380 return ReturnError(c, "No user was specified", 195, 403)
381 }
382 } else {
383 id, err := strconv.ParseInt(actor, 10, 64)
384 if err != nil {
385 return ReturnError(c, "Invalid ID format", 195, 403)
386 }
387 actorPtr, err := bridge.TwitterIDToBlueSky(&id)
388 if err != nil {
389 return ReturnError(c, "ID not found.", 144, fiber.StatusNotFound)
390 }
391 if actorPtr == nil {
392 return ReturnError(c, "ID not found.", 144, fiber.StatusNotFound)
393 }
394 actor = *actorPtr
395 }
396 return UnfollowUser(c, actor)
397}
398
399func UnfollowUserParams(c *fiber.Ctx) error {
400 // This should allow lookup with a handle, but tbh, i'm too lazy to implement that right now as i do not see it being used.

Callers

nothing calls this directly

Calls 3

TwitterIDToBlueSkyFunction · 0.92
ReturnErrorFunction · 0.85
UnfollowUserFunction · 0.70

Tested by

no test coverage detected