Advertisement
Guest User

init.en.*.js

a guest
Nov 6th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var i = {
  2.     AlreadyRetweeted: t,
  3.     BlockedUserError: function(e) {
  4.         switch (e.eventName) {
  5.             case "dataFailedToFavoriteTweet":
  6.                 this.showApiErrorToast(o.a.BLOCKED_FROM_LIKE);
  7.                 break;
  8.             case "dataFailedToRetweet":
  9.                 this.showApiErrorToast(o.a.BLOCKED_FROM_RETWEET);
  10.                 break;
  11.             default:
  12.                 this.showApiErrorToast(o.a.BLOCKED_DEFAULT)
  13.         }
  14.     },
  15.     CurrentUserSuspended: function(e) {
  16.         a.a.user.needsPhoneVerification ? this.showApiErrorToast(o.a.PLEASE_ADD_PHONE_TO_FINISH) : this.showApiErrorToast(o.a.SUSPENDED_DEFAULT)
  17.     },
  18.     DeactivatedUser: e(o.a.SORRY_COULD_NOT_FIND_USER),
  19.     DeniedByApiCsrfProtection: t,
  20.     DeviceAlreadyRegistered: e(o.a.DEVICE_ALREADY_REGISTERED),
  21.     DeviceOperatorUnsupported: e(o.a.DEVICE_OPERATOR_UNSUPPORTED),
  22.     DeviceRegistrationGeneralError: e(o.a.DEVICE_REGISTRATION_GENERAL_ERROR),
  23.     DirectMessageCannotDmOtherUser: e(o.a.CANNOT_MESSAGE_THIS_ACCOUNT),
  24.     DirectMessageDuplicate: e(o.a.WHOOPS_YOU_ALREADY_SAID_THAT),
  25.     DirectMessageTooLongError: e(o.a.DM_TOO_LONG),
  26.     DuplicateFavorite: t,
  27.     FollowRateLimitExceeded: e(o.a.FOLLOW_RATE_LIMITED),
  28.     ForbiddenMissingParameter: e(o.a.YOUR_ACCOUNT_MAY_NOT_BE_ALLOWED),
  29.     GenericBadRequest: e(o.a.WE_DID_SOMETHING_WRONG),
  30.     GenericNotFound: e(o.a.WE_DID_SOMETHING_WRONG),
  31.     GenericSuspended: function(e) {
  32.         a.a && a.a.user && a.a.user.needsPhoneVerification ? this.showApiErrorToast(o.a.PLEASE_ADD_PHONE_TO_FINISH) : this.showApiErrorToast(o.a.ACCOUNT_SUSPENDED)
  33.     },
  34.     GenericUserNotFound: e(o.a.SORRY_COULD_NOT_FIND_USER),
  35.     InactiveUser: e(o.a.SUSPENDED_DEFAULT),
  36.     InternalError: e(o.a.WE_DID_SOMETHING_WRONG),
  37.     InvalidCredentials: e(o.a.YOUR_ACCOUNT_MAY_NOT_BE_ALLOWED),
  38.     InvalidCurrentPassword: e(o.a.INVALID_CURRENT_PASSWORD),
  39.     InvalidMediaId: e(o.a.INVALID_MEDIA),
  40.     InvalidRequestUrlForbidden: e(o.a.CANNOT_ATTACH_MEDIA),
  41.     OtherUserSuspended: e(o.a.ACCOUNT_SUSPENDED),
  42.     OverCapacity: e(o.a.API_OVER_CAPACITY),
  43.     RateLimitExceeded: e(o.a.SORRY_RATE_LIMITED),
  44.     StatusNotFound: e(o.a.TWEET_IS_DELETED),
  45.     StatusNotFoundForbidden: e(o.a.TWEET_IS_DELETED),
  46.     TieredActionChallengeCaptcha: e(o.a.REQUEST_LOOKS_AUTOMATED),
  47.     TieredActionFavoriteSpammer: e(o.a.REQUEST_LOOKS_AUTOMATED),
  48.     TieredActionFollowCreeper: e(o.a.CREEPER_FOLLOW),
  49.     TieredActionTweetCreeper: e(o.a.CREEPER_TWEET),
  50.     UserActionRateLimitExceeded: e(o.a.DAILY_RATE_LIMIT_ADD_PHONE),
  51.     UserAlreadyHasVerifiedPhone: e(o.a.USER_ALREADY_HAS_VERIFIED_PHONE),
  52.     UserMustBeAlcoholAgeScreened: function(e) {
  53.         e.eventName
  54.     },
  55.     ValidationFailure: function(e) {
  56.         if ("dataMuteKeywordsAddKeywordFailed" === e.eventName) {
  57.             var t = e.data.errors[0].message;
  58.             this.trigger("dataMuteKeywordsAddKeywordFailure", {
  59.                 error_message: t
  60.             })
  61.         }
  62.     },
  63.     IneligibleFor2faAfterModification: t
  64. };
  65. this.showApiErrorToast = function(e) {
  66.     this.trigger("uiShowError", {
  67.         message: e
  68.     })
  69. }, this.getApiErrorDataField = function(e, t) {
  70.     return e && e.errors && e.errors[0] ? e.errors[0][t] : void 0
  71. }, this.handleApiError = function(e, t, n, a) {
  72.     if (void 0 !== t) {
  73.         var s = i[o.b[t]];
  74.         void 0 !== s ? s.call(this, {
  75.             eventName: e,
  76.             data: a
  77.         }) : this.showApiErrorToast(Object(r.default)("Sorry, something went wrong."))
  78.     } else void 0 !== n && (429 === n ? this.trigger("uiShowError", {
  79.         message: o.a.SORRY_RATE_LIMITED
  80.     }) : 403 === n && this.trigger("uiShowError", {
  81.         message: o.a.YOUR_ACCOUNT_MAY_NOT_BE_ALLOWED
  82.     }));
  83.     return Promise.resolve()
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement