예제 #1
0
 public void getOtherMsg(String lccno, String operate, Message msg) throws Exception {
   if (Constants.OTHERMSG_OPERATE_CANCELSENDFILE.equals(operate)) {
     String streamID = (String) msg.getProperty("streamID");
     Date sendDate = new Date((Long) msg.getProperty("sendDate"));
     FileTransferRequest req = DataUtil.getFileTransferRequest(streamID);
     MessageFrame msgFrame = getMessageFrame();
     MemberBean memberBean = TreeUtil.getMemberBeanByLccno(lccno);
     final FriendChatPanel panel = getFriendChatPanel(memberBean);
     String info =
         StringUtil.getFormatString(
             getUIString("sendFile.otherCancel"), "\"" + req.getFileName() + "\"");
     panel.otherCancelSendFile(streamID, sendDate, info);
     msgFrame.setVisible(true);
   }
 }
예제 #2
0
파일: Message.java 프로젝트: arpit87/SB1
 /**
  * Construct a message from a smack message packet.
  *
  * @param smackMsg Smack message packet
  */
 public Message(final org.jivesoftware.smack.packet.Message smackMsg) {
   mTo = smackMsg.getTo();
   mType = (Integer) smackMsg.getProperty(SBMSGTYPE);
   /*switch (smackMsg.getType()) {
       case chat:
   	mType = MSG_TYPE_CHAT;
   	break;
       case groupchat:
   	mType = MSG_TYPE_NEWUSER_BROADCAST;
   	break;
       case normal:
   	mType = MSG_TYPE_NORMAL;
   	break;
       case headline:
       mType = MSG_TYPE_ACK;
       case error:
   	mType = MSG_TYPE_ERROR;
   	break;
       default:
   	Log.w(TAG, "message type error" + smackMsg.getType());
   	break;
   }*/
   this.mFrom = smackMsg.getFrom();
   if (mType == MSG_TYPE_ERROR) {
     XMPPError er = smackMsg.getError();
     String msg = er.getMessage();
     if (msg != null) mBody = msg;
     else mBody = er.getCondition();
   } else {
     mBody = smackMsg.getBody();
     mSubject = smackMsg.getSubject();
     mThread = smackMsg.getThread();
     mTime = (String) smackMsg.getProperty("time");
     mUniqueMsgIdentifier = (Long) smackMsg.getProperty(UNIQUEID);
   }
 }