示例#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());
    }
  }
示例#2
0
 @Override
 public boolean onContextItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case MENU_DELETE_MESSAGE:
       if (chatRoom != null) {
         LinphoneChatMessage message = getMessageForId(item.getGroupId());
         if (message != null) {
           chatRoom.deleteMessage(message);
           invalidate();
         }
       }
       break;
     case MENU_COPY_TEXT:
       copyTextMessageToClipboard(item.getGroupId());
       break;
     case MENU_RESEND_MESSAGE:
       resendMessage(item.getGroupId());
       break;
   }
   return true;
 }