totalLength == currentLength) {
MsnP2PSlpMessage slpMessage = new MsnP2PSlpMessage();
slpMessage.parseMessage(message);
MsnslpMessage msg = slpMessage.getSlpMessage();
if (msg instanceof MsnslpRequest) {
MsnslpRequest msnslpRequest = (MsnslpRequest) slpMessage
.getSlpMessage();
if (msnslpRequest.getRequestMethod() != null &&
msnslpRequest.getRequestMethod().
equals(MsnP2PByeMessage.METHOD_BYE)) {
return new MsnP2PByeMessage();
}
if (msnslpRequest.getRequestMethod() != null
&& msnslpRequest.getRequestMethod().
equals(MsnP2PInvitationMessage.METHOD_INVITE)) {
return new MsnP2PInvitationMessage();
}
}
return slpMessage;
}
if(flag == MsnP2PMessage.FLAG_OLD_NONE)
{
MsnP2PSlpMessage slpMessage = new MsnP2PSlpMessage();
slpMessage.parseMessage(message);
MsnslpMessage msg = slpMessage.getSlpMessage();
if (msg instanceof MsnslpRequest)
{
MsnslpRequest msnslpRequest = (MsnslpRequest) slpMessage
.getSlpMessage();
if (msnslpRequest.getRequestMethod() == null)
return slpMessage;
if (msnslpRequest.getRequestMethod().
equals(MsnFileInviteMessage.METHOD_INVITE))
{
return new MsnFileInviteMessage();
}
// bye
if (msnslpRequest.getRequestMethod().
equals(MsnFileByeMessage.METHOD_BYE))
{
return new MsnFileByeMessage();
}
}