@Override
 public void onReceiveWithoutSms(Context context, int partNum, int res) {
   answerTo = null;
   Log.w("sms in smsMap missing");
   switch (res) {
     case Activity.RESULT_OK:
       send(context.getString(R.string.chat_sms_delivered));
       break;
     case Activity.RESULT_CANCELED:
       send(context.getString(R.string.chat_sms_not_delivered));
       break;
   }
 }
Example #2
0
  /**
   * retrieves the current xmpp rooster and sends a broadcast ACTION_XMPP_PRESENCE_CHANGED for every
   * friend does nothing if we are offline
   *
   * @return
   */
  public ArrayList<XmppFriend> retrieveFriendList() {

    ArrayList<XmppFriend> friends = new ArrayList<XmppFriend>();

    if (sConnection != null && sConnection.isAuthenticated()) {
      try {
        String userID = null;
        String status = null;
        Roster roster = sConnection.getRoster();

        for (RosterEntry r : roster.getEntries()) {
          userID = r.getUser();
          status = retrieveStatusMessage(userID);
          friends.add(new XmppFriend(userID, r.getName(), status, retrieveState(userID)));
        }

        sendFriendList(friends);
      } catch (Exception ex) {
        Log.w("Failed to retrieve Xmpp Friend list", ex);
      }
    }

    return friends;
  }