Fixes Ad-hoc related problems, reported by Lubomir Marinov on the dev mailing list (subject: Re: GSoC Wrap Up Report 2009 from September 30, 10:35CET).

Also removes an unused method from the ad hoc operation set and all related implementations.
cusax-fix
Yana Stamcheva 17 years ago
parent bd861dc6b4
commit 8755b21975

@ -268,23 +268,6 @@ private AdHocChatRoom createLocalChatRoomInstance(
}
}
/**
* Returns true if <tt>contact</tt> supports multi user chat sessions.
*
* @param contact reference to the contact whose support for chat rooms we
* are currently querying.
* @return a boolean indicating whether <tt>contact</tt> supports chat
* rooms.
*/
public boolean isMultiChatSupportedByContact(Contact contact)
{
if (contact.getProtocolProvider().getOperationSet(
OperationSetAdHocMultiUserChat.class) != null)
return true;
return false;
}
/**
* Informs the sender of an invitation that we decline their invitation.
*

@ -23,6 +23,9 @@
public class OperationSetAdHocMultiUserChatMsnImpl
implements OperationSetAdHocMultiUserChat
{
/**
* The logger used to log messages.
*/
private static final Logger logger
= Logger.getLogger(OperationSetAdHocMultiUserChatMsnImpl.class);
@ -67,6 +70,7 @@ public class OperationSetAdHocMultiUserChatMsnImpl
/**
* Creates an <tt>OperationSetAdHocMultiUserChatMsnImpl</tt> by specifying
* the parent provider.
* @param provider the Msn provider
*/
public OperationSetAdHocMultiUserChatMsnImpl(
ProtocolProviderServiceMsnImpl provider)
@ -170,6 +174,7 @@ public Message createMessage(String messageText)
* @param adHocRoomName the name of the ad-hoc room
* @param contacts the list of contacts
*
* @return the ad-hoc room that has been just created
* @throws OperationFailedException
* @throws OperationNotSupportedException
*/
@ -200,6 +205,7 @@ public AdHocChatRoom createAdHocChatRoom( String adHocRoomName,
* @param adHocRoomName the name of the ad-hoc room
* @param adHocRoomProperties the ad-hoc room's properties
*
* @return the created ad-hoc room
* @throws OperationFailedException
* @throws OperationNotSupportedException
*/
@ -367,11 +373,6 @@ public boolean isGroupChatMessage(MsnSwitchboard switchboard)
}
}
public boolean isMultiChatSupportedByContact(Contact contact)
{
return false;
}
/**
* Removes the given listener from presence listeners' list.
*
@ -445,6 +446,12 @@ private class MsnMessageListener
extends MsnMessageAdapter
implements MsnEmailListener
{
/**
* Indicates that an instant message has been received.
* @param switchboard the switchboard
* @param message the message
* @param contact the contact sending the message
*/
public void instantMessageReceived( MsnSwitchboard switchboard,
MsnInstantMessage message,
MsnContact contact)
@ -479,28 +486,35 @@ public void instantMessageReceived( MsnSwitchboard switchboard,
chatRoom.fireMessageEvent(msgReceivedEvent);
}
/**
* Not interested in this event.
*/
public void initialEmailNotificationReceived(
MsnSwitchboard switchboard, MsnEmailInitMessage message,
MsnContact contact)
{
}
{}
/**
* Not interested in this event.
*/
public void initialEmailDataReceived(MsnSwitchboard switchboard,
MsnEmailInitEmailData message, MsnContact contact)
{
}
{}
/**
* Not interested in this event.
*/
public void newEmailNotificationReceived(MsnSwitchboard switchboard,
MsnEmailNotifyMessage message, MsnContact contact)
{
}
{}
/**
* Not interested in this event.
*/
public void activityEmailNotificationReceived(
MsnSwitchboard switchboard, MsnEmailActivityMessage message,
MsnContact contact)
{
}
{}
}
/**
@ -511,6 +525,12 @@ public void activityEmailNotificationReceived(
private class MsnSwitchboardListener
extends MsnSwitchboardAdapter
{
/**
* Indicates that the given <tt>msnContact</tt> has joined the given
* <tt>switchboard</tt>.
* @param switchboard the switchboard
* @param msnContact the contact that has joined
*/
public void contactJoinSwitchboard( MsnSwitchboard switchboard,
MsnContact msnContact)
{
@ -550,9 +570,14 @@ public void contactJoinSwitchboard( MsnSwitchboard switchboard,
{
logger.error("Failed to join switchboard.", e);
}
}
/**
* Indicates that the given <tt>contact</tt> has left the given
* <tt>switchboard</tt>.
* @param switchboard the switchboard
* @param contact the contact that has left
*/
public void contactLeaveSwitchboard(MsnSwitchboard switchboard,
MsnContact contact)
{
@ -563,9 +588,7 @@ public void contactLeaveSwitchboard(MsnSwitchboard switchboard,
= getLocalAdHocChatRoomInstance(switchboard);
if (chatRoom == null)
{
chatRoom = createLocalAdHocChatRoomInstance(switchboard);
}
return;
String participantId = contact.getId();
@ -578,6 +601,10 @@ public void contactLeaveSwitchboard(MsnSwitchboard switchboard,
}
}
/**
* Indicates that a switchboard has been closed.
* @param switchboard the switchboard that has been closed
*/
public void switchboardClosed(MsnSwitchboard switchboard)
{
AdHocChatRoomMsnImpl adHocChatRoom
@ -596,6 +623,10 @@ public void switchboardClosed(MsnSwitchboard switchboard)
}
}
/**
* Indicates that a switchboard has been started.
* @param switchboard the switchboard that has been started
*/
public void switchboardStarted(MsnSwitchboard switchboard)
{
Object switchboardID = switchboard.getAttachment();
@ -617,10 +648,6 @@ public void switchboardStarted(MsnSwitchboard switchboard)
// Add this room to the list of created chat rooms.
adHocChatRoomCache.put(switchboard, adHocChatRoom);
}
else
{
logger.debug("Could not join the Ad-hoc chat room.");
}
}
}

@ -338,24 +338,6 @@ private AdHocChatRoomYahooImpl getLocalChatRoomInstance(
return null;
}
/**
* Returns true if <tt>contact</tt> supports multi user chat sessions.
*
* @param contact reference to the contact whose support for chat rooms we
* are currently querying.
* @return a boolean indicating whether <tt>contact</tt> supports chatrooms.
* @todo Implement this
* net.java.sip.communicator.service.protocol.OperationSetMultiUserChat
* method
*/
public boolean isMultiChatSupportedByContact(Contact contact)
{
return
(contact.getProtocolProvider()
.getOperationSet(OperationSetAdHocMultiUserChat.class)
!= null);
}
/**
* Informs the sender of an invitation that we decline their invitation.
*

@ -75,16 +75,6 @@ public AdHocChatRoom createAdHocChatRoom(String adHocRoomName,
*/
public List<AdHocChatRoom> getAdHocChatRooms();
/**
* Returns true if <tt>contact</tt> supports multi-user chat sessions.
*
* @param contact reference to the contact whose support for ad-hoc chat
* rooms we are currently querying.
* @return a boolean indicating whether <tt>contact</tt> supports ad-hoc
* chat rooms.
*/
public boolean isMultiChatSupportedByContact(Contact contact);
/**
* Adds a listener that will be notified of changes in our participation in
* an ad-hoc chat room such as us being joined, left.

Loading…
Cancel
Save