From c7e4afa66c2f16bed6fb5a4fcdb2d68a95290fce Mon Sep 17 00:00:00 2001 From: Valentin Martinet Date: Sat, 16 Jan 2010 18:34:19 +0000 Subject: [PATCH] Fix an error in Yahoo MUC : An external inviter was not added to the room by the Yahoo MUC operation set --- ...erationSetAdHocMultiUserChatYahooImpl.java | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetAdHocMultiUserChatYahooImpl.java b/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetAdHocMultiUserChatYahooImpl.java index c06b517f7..de95c843f 100644 --- a/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetAdHocMultiUserChatYahooImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetAdHocMultiUserChatYahooImpl.java @@ -315,6 +315,34 @@ private AdHocChatRoomYahooImpl createLocalChatRoomInstance( return newChatRoom; } } + + /** + * Creates a AdHocChatRoom instance from the specified Yahoo + * conference. + * + * @param yahooConference The chat room model from the yahoo lib. + * + * @return AdHocChatRoom the chat room that we've just created. + */ + private AdHocChatRoomYahooImpl createLocalChatRoomInstance( + YahooConference yahooConference, String inviterID) + { + synchronized (chatRoomCache) + { + AdHocChatRoomYahooImpl newChatRoom + = new AdHocChatRoomYahooImpl(yahooConference, yahooProvider); + + OperationSetPersistentPresenceYahooImpl opSetPresence = + (OperationSetPersistentPresenceYahooImpl) yahooProvider + .getOperationSet(OperationSetPersistentPresence.class); + + newChatRoom.addChatRoomParticipant( + opSetPresence.findContactByID(inviterID)); + chatRoomCache.put(yahooConference.getName(), newChatRoom); + + return newChatRoom; + } + } /** * Returns the AdHocChatRoomYahooImpl corresponding to the given @@ -550,14 +578,16 @@ public void conferenceInviteReceived(SessionConferenceEvent ev) try { AdHocChatRoom chatRoom = getLocalChatRoomInstance(ev.getRoom()); - + if (chatRoom == null) { - chatRoom = createLocalChatRoomInstance(ev.getRoom()); - - fireInvitationEvent(chatRoom, ev.getFrom(), ev.getMessage()); + chatRoom = + createLocalChatRoomInstance(ev.getRoom(), ev.getFrom()); + + fireInvitationEvent( + chatRoom, ev.getFrom(), ev.getMessage()); } - + } catch (Exception e) {