Example #1
0
  private void resendMessage(int id) {
    LinphoneChatMessage message = getMessageForId(id);
    if (message == null) return;

    chatRoom.deleteMessage(getMessageForId(id));
    invalidate();

    if (message.getText() != null && message.getText().length() > 0) {
      sendTextMessage(message.getText());
    } else {
      sendImageMessage(message.getAppData());
    }
  }
  private void resendMessage(int id) {
    LinphoneChatMessage message = getMessageForId(id);
    if (message == null) return;

    LinphoneActivity.instance().getChatStorage().deleteMessage(chatRoom, id);
    hideMessageBubble(id);

    if (message.getText() != null && message.getText().length() > 0) {
      sendTextMessage(message.getText());
    } else {
      sendImageMessage(message.getExternalBodyUrl(), null);
    }
  }
Example #3
0
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == ADD_PHOTO && resultCode == Activity.RESULT_OK) {
      String fileToUploadPath = null;

      if (data != null && data.getData() != null) {
        fileToUploadPath = getRealPathFromURI(data.getData());
      } else if (imageToUploadUri != null) {
        fileToUploadPath = imageToUploadUri.getPath();
      }

      if (fileToUploadPath != null) {
        sendImageMessage(fileToUploadPath);
      }
    } else {
      super.onActivityResult(requestCode, resultCode, data);
    }
  }