Adds support for invitation reason (Yahoo! & ICQ)

cusax-fix
Valentin Martinet 16 years ago
parent 03d18ef581
commit a3b27e8724

@ -1957,7 +1957,8 @@ public void inviteContacts( ChatTransport inviteChatTransport,
{
ChatRoomWrapper chatRoomWrapper
= conferenceChatManager.createChatRoom(
inviteChatTransport.getProtocolProvider(), chatContacts);
inviteChatTransport.getProtocolProvider(),
chatContacts);
conferenceChatSession
= new ConferenceChatSession(this, chatRoomWrapper);
@ -1968,7 +1969,8 @@ else if (inviteChatTransport.getProtocolProvider().
AdHocChatRoomWrapper chatRoomWrapper
= conferenceChatManager.createAdHocChatRoom(
inviteChatTransport.getProtocolProvider(),
chatContacts);
chatContacts,
reason);
conferenceChatSession
= new AdHocConferenceChatSession(this, chatRoomWrapper);

@ -762,12 +762,14 @@ public ChatRoomWrapper createChatRoom(
*
* @param protocolProvider the parent protocol provider.
* @param contacts the contacts invited when creating the chat room.
* @param reason the reason for this invitation
* @return the <tt>AdHocChatRoomWrapper</tt> corresponding to the created
* ad hoc chat room
*/
public AdHocChatRoomWrapper createAdHocChatRoom(
ProtocolProviderService protocolProvider,
Collection<String> contacts)
Collection<String> contacts,
String reason)
{
AdHocChatRoomWrapper chatRoomWrapper = null;
@ -795,8 +797,7 @@ public AdHocChatRoomWrapper createAdHocChatRoom(
chatRoom = groupChatOpSet.createAdHocChatRoom(
"chatroom-" + new Date().getTime(),
members);
"chatroom-" + new Date().getTime(), members, reason);
}
catch (OperationFailedException ex)
{

@ -194,13 +194,14 @@ public AdHocChatRoom createAdHocChatRoom(String roomName,
*
* @param adHocRoomName the name of the ad-hoc room
* @param contacts the list of contacts
* @param reason the reason to be sent with the invitation for contacts.
*
* @return the ad-hoc room that has been just created
* @throws OperationFailedException
* @throws OperationNotSupportedException
*/
public AdHocChatRoom createAdHocChatRoom(String adHocRoomName,
List<Contact> contacts)
List<Contact> contacts, String reason)
throws OperationFailedException,
OperationNotSupportedException
{
@ -213,7 +214,7 @@ public AdHocChatRoom createAdHocChatRoom(String adHocRoomName,
{
ContactIcqImpl newContact = (ContactIcqImpl) contact;
adHocChatRoom.invite(newContact.getAddress(), "");
adHocChatRoom.invite(newContact.getAddress(), reason);
}
}

@ -173,13 +173,16 @@ public Message createMessage(String messageText)
*
* @param adHocRoomName the name of the ad-hoc room
* @param contacts the list of contacts
* @param reason the reason (will not be used since MSN does not support
* invitation with the possibility to reject it)
*
* @return the ad-hoc room that has been just created
* @throws OperationFailedException
* @throws OperationNotSupportedException
*/
public AdHocChatRoom createAdHocChatRoom( String adHocRoomName,
List<Contact> contacts)
List<Contact> contacts,
String reason)
throws OperationFailedException, OperationNotSupportedException
{
AdHocChatRoom adHocChatRoom = createAdHocChatRoom(
@ -191,7 +194,7 @@ public AdHocChatRoom createAdHocChatRoom( String adHocRoomName,
{
ContactMsnImpl newContact = (ContactMsnImpl) contact;
adHocChatRoom.invite(newContact.getAddress(), "");
adHocChatRoom.invite(newContact.getAddress(), reason);
}
}
@ -199,8 +202,8 @@ public AdHocChatRoom createAdHocChatRoom( String adHocRoomName,
}
/**
* Creates an <tt>AdHocChatRoom</tt> whose name is _adHocRoomName with the
* properties contained in _adHocRoomProperties
* Creates an <tt>AdHocChatRoom</tt> whose name is adHocRoomName with the
* properties contained in adHocRoomProperties
*
* @param adHocRoomName the name of the ad-hoc room
* @param adHocRoomProperties the ad-hoc room's properties
@ -227,7 +230,7 @@ public AdHocChatRoom createAdHocChatRoom(String adHocRoomName,
// when the room hasn't been created, we create it.
adHocRoom = createLocalAdHocChatRoomInstance(adHocRoomName, id);
}
return adHocRoom;
}
@ -245,7 +248,7 @@ private AdHocChatRoomMsnImpl createLocalAdHocChatRoomInstance(
{
AdHocChatRoomMsnImpl adHocChatRoom =
new AdHocChatRoomMsnImpl(adHocChatRoomName, this.provider);
// We put it to the pending ad hoc chat rooms, waiting for the
// switchboard to be created.
this.pendingAdHocChatRoomList.put(switchboardId, adHocChatRoom);
@ -533,7 +536,7 @@ public void contactJoinSwitchboard( MsnSwitchboard switchboard,
{
if (!isGroupChatMessage(switchboard))
return;
try
{
AdHocChatRoomMsnImpl chatRoom
@ -543,7 +546,7 @@ public void contactJoinSwitchboard( MsnSwitchboard switchboard,
{
chatRoom = createLocalAdHocChatRoomInstance(switchboard);
}
OperationSetPersistentPresenceMsnImpl presenceOpSet
= (OperationSetPersistentPresenceMsnImpl) provider
.getOperationSet(OperationSetPersistentPresence.class);
@ -626,8 +629,8 @@ public void switchboardClosed(MsnSwitchboard switchboard)
*/
public void switchboardStarted(MsnSwitchboard switchboard)
{
Object switchboardID = switchboard.getAttachment();
Object switchboardID = switchboard.getAttachment();
AdHocChatRoomMsnImpl adHocChatRoom = null;
if (switchboardID != null
&& pendingAdHocChatRoomList.containsKey(switchboardID))

@ -218,24 +218,24 @@ public AdHocChatRoom createAdHocChatRoom(String roomName,
Map<String, Object> roomProperties)
throws OperationFailedException
{
return createAdHocChatRoom(roomName, (String[]) null);
return createAdHocChatRoom(roomName, (String[]) null, "");
}
/**
* Creates an ad-hoc room with the named <tt>adHocRoomName</tt> and in
* including to the specified <tt>contacts</tt>. When the method returns the
* ad-hoc room the local user will not have joined it and thus will not
* receive messages on it until the <tt>AdHocChatRoom.join()</tt> method is
* called.
* ad-hoc room the local user will have joined it.
*
* @return the ad-hoc room that has been just created
* @param adHocRoomName the name of the room to be created
* @param contacts the list of contacts
* @param reason the reason for contacts' invitation
* @throws OperationFailedException if the room couldn't be created for
* some reason
*/
public AdHocChatRoom createAdHocChatRoom( String adHocRoomName,
List<Contact> contacts)
List<Contact> contacts,
String reason)
throws OperationFailedException
{
String[] invitedContacts = null; // parameter used for room's creation
@ -258,12 +258,22 @@ public AdHocChatRoom createAdHocChatRoom( String adHocRoomName,
}
}
return createAdHocChatRoom(adHocRoomName, invitedContacts);
return createAdHocChatRoom(adHocRoomName, invitedContacts, reason);
}
/**
*
*
* @param roomName name of the chatroom
* @param invitedContacts contacts to be invited to this room
* @param reason reason of this invitation
* @return AdHocChatRoom the ad-hoc room that has been just created
* @throws OperationFailedException
*/
private AdHocChatRoom createAdHocChatRoom(
String roomName,
String[] invitedContacts)
String[] invitedContacts,
String reason)
throws OperationFailedException
{
if (invitedContacts == null)
@ -276,7 +286,7 @@ private AdHocChatRoom createAdHocChatRoom(
YahooConference conference =
yahooProvider.getYahooSession().createConference(
invitedContacts, // users invited to this conference
"", // invite message / topic
reason, // invite message / topic
yahooProvider.getYahooSession().getLoginIdentity());
chatRoom = createLocalChatRoomInstance(conference);

Loading…
Cancel
Save