Exemplo n.º 1
0
 @Override
 public boolean onContextItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case MENU_DELETE_MESSAGE:
       LinphoneActivity.instance().getChatStorage().deleteMessage(chatRoom, item.getGroupId());
       hideMessageBubble(item.getGroupId());
       break;
     case MENU_SAVE_PICTURE:
       saveImage(item.getGroupId());
       break;
     case MENU_COPY_TEXT:
       copyTextMessageToClipboard(item.getGroupId());
       break;
     case MENU_PICTURE_SMALL:
       uploadAndSendImage(fileToUploadPath, imageToUpload, ImageSize.SMALL);
       break;
     case MENU_PICTURE_MEDIUM:
       uploadAndSendImage(fileToUploadPath, imageToUpload, ImageSize.MEDIUM);
       break;
     case MENU_PICTURE_LARGE:
       uploadAndSendImage(fileToUploadPath, imageToUpload, ImageSize.LARGE);
       break;
     case MENU_PICTURE_REAL:
       uploadAndSendImage(fileToUploadPath, imageToUpload, ImageSize.REAL);
       break;
     case MENU_RESEND_MESSAGE:
       resendMessage(item.getGroupId());
       break;
   }
   return true;
 }
Exemplo n.º 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);
    }
  }