コード例 #1
0
ファイル: ChatFragment.java プロジェクト: hrsyah1970/SIPTKI
  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());
    }
  }
コード例 #2
0
  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);
    }
  }
コード例 #3
0
ファイル: ChatFragment.java プロジェクト: hrsyah1970/SIPTKI
  @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);
    }
  }