Exemple #1
0
  public void setOAuthTokenWithSecret(
      String oAuthToken, String oAuthSecret, boolean cancelPending) {

    if (oAuthToken == null && mCurrentOAuthToken == null) {
      return;
    } else if (oAuthToken != null
        && mCurrentOAuthToken != null
        && oAuthToken.equals(mCurrentOAuthToken) == true) {
      return;
    } else if (oAuthSecret != null
        && mCurrentOAuthSecret != null
        && oAuthSecret.equals(mCurrentOAuthSecret) == true) {
      return;
    }

    if (cancelPending == true) {
      mFetchBooleans.clearCallbacks();
      mFetchLists.clearCallbacks();
      mFetchDirectMessages.clearCallbacks();
      mFetchStatus.clearCallbacks();
      mFetchStatuses.clearCallbacks();
      mFetchUser.clearCallbacks();
      mFetchUsers.clearCallbacks();
      mModifyStatuses.clearCallbacks();
    }

    mCurrentOAuthToken = oAuthToken;
    mCurrentOAuthSecret = oAuthSecret;

    clearApiInstance();
    getAndConfigureApiInstance();
  }
Exemple #2
0
 public void sendDirectMessage(
     long userId,
     String recipientScreenName,
     String statusText,
     TwitterFetchDirectMessagesFinishedCallback callback) {
   mFetchDirectMessages.sendDirectMessage(
       userId, recipientScreenName, statusText, callback, mConnectionStatus);
 }
Exemple #3
0
 public TwitterDirectMessages getDirectMessages(
     TwitterContentHandle contentHandle,
     TwitterPaging paging,
     TwitterFetchDirectMessagesFinishedCallback callback) {
   TwitterDirectMessages cachedMessages =
       mFetchDirectMessages.getDirectMessages(contentHandle, paging, callback, mConnectionStatus);
   return cachedMessages;
 }
Exemple #4
0
  private void initFetchDirectMessages() {

    mFetchDirectMessages = new TwitterFetchDirectMessages();

    FetchMessagesWorkerCallbacks callbacks =
        new FetchMessagesWorkerCallbacks() {

          public Twitter getTwitterInstance() {
            return SocialNetApi.this.getAndConfigureApiInstance();
          }

          @Override
          public void addUser(User user) {
            cacheUser(user);
          }
        };

    mFetchDirectMessages.setWorkerCallbacks(callbacks);
  }
Exemple #5
0
 public TwitterDirectMessages getDirectMessages(TwitterContentHandle contentHandle) {
   TwitterDirectMessages cachedMessages = mFetchDirectMessages.getDirectMessages(contentHandle);
   return cachedMessages;
 }