aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java
diff options
context:
space:
mode:
authorValentin Martinet <vmartinet@java.net>2010-01-17 15:29:48 +0000
committerValentin Martinet <vmartinet@java.net>2010-01-17 15:29:48 +0000
commita3b27e8724b1f0b8b6579de45e8027fab70f809d (patch)
tree47b8479d74c2666799378c9d58de839ae6a572f3 /src/net/java
parent03d18ef581f76be4a97b2dcf6c9098479927fe42 (diff)
downloadjitsi-a3b27e8724b1f0b8b6579de45e8027fab70f809d.zip
jitsi-a3b27e8724b1f0b8b6579de45e8027fab70f809d.tar.gz
jitsi-a3b27e8724b1f0b8b6579de45e8027fab70f809d.tar.bz2
Adds support for invitation reason (Yahoo! & ICQ)
Diffstat (limited to 'src/net/java')
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java6
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java7
-rw-r--r--src/net/java/sip/communicator/impl/protocol/icq/OperationSetAdHocMultiUserChatIcqImpl.java5
-rw-r--r--src/net/java/sip/communicator/impl/protocol/msn/OperationSetAdHocMultiUserChatMsnImpl.java23
-rw-r--r--src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetAdHocMultiUserChatYahooImpl.java26
5 files changed, 42 insertions, 25 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
index 56d03a7..20166d9 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
@@ -1957,7 +1957,8 @@ public class ChatPanel
{
ChatRoomWrapper chatRoomWrapper
= conferenceChatManager.createChatRoom(
- inviteChatTransport.getProtocolProvider(), chatContacts);
+ inviteChatTransport.getProtocolProvider(),
+ chatContacts);
conferenceChatSession
= new ConferenceChatSession(this, chatRoomWrapper);
@@ -1968,7 +1969,8 @@ public class ChatPanel
AdHocChatRoomWrapper chatRoomWrapper
= conferenceChatManager.createAdHocChatRoom(
inviteChatTransport.getProtocolProvider(),
- chatContacts);
+ chatContacts,
+ reason);
conferenceChatSession
= new AdHocConferenceChatSession(this, chatRoomWrapper);
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java
index a6376d5..1f0bb97 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java
@@ -762,12 +762,14 @@ public class ConferenceChatManager
*
* @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 class ConferenceChatManager
chatRoom = groupChatOpSet.createAdHocChatRoom(
- "chatroom-" + new Date().getTime(),
- members);
+ "chatroom-" + new Date().getTime(), members, reason);
}
catch (OperationFailedException ex)
{
diff --git a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetAdHocMultiUserChatIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetAdHocMultiUserChatIcqImpl.java
index 05d7fdb..a951102 100644
--- a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetAdHocMultiUserChatIcqImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetAdHocMultiUserChatIcqImpl.java
@@ -194,13 +194,14 @@ public class OperationSetAdHocMultiUserChatIcqImpl
*
* @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 class OperationSetAdHocMultiUserChatIcqImpl
{
ContactIcqImpl newContact = (ContactIcqImpl) contact;
- adHocChatRoom.invite(newContact.getAddress(), "");
+ adHocChatRoom.invite(newContact.getAddress(), reason);
}
}
diff --git a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetAdHocMultiUserChatMsnImpl.java b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetAdHocMultiUserChatMsnImpl.java
index fdde12b..267df29 100644
--- a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetAdHocMultiUserChatMsnImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetAdHocMultiUserChatMsnImpl.java
@@ -173,13 +173,16 @@ public class OperationSetAdHocMultiUserChatMsnImpl
*
* @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 class OperationSetAdHocMultiUserChatMsnImpl
{
ContactMsnImpl newContact = (ContactMsnImpl) contact;
- adHocChatRoom.invite(newContact.getAddress(), "");
+ adHocChatRoom.invite(newContact.getAddress(), reason);
}
}
@@ -199,8 +202,8 @@ public class OperationSetAdHocMultiUserChatMsnImpl
}
/**
- * 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 class OperationSetAdHocMultiUserChatMsnImpl
// when the room hasn't been created, we create it.
adHocRoom = createLocalAdHocChatRoomInstance(adHocRoomName, id);
}
-
+
return adHocRoom;
}
@@ -245,7 +248,7 @@ public class OperationSetAdHocMultiUserChatMsnImpl
{
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 class OperationSetAdHocMultiUserChatMsnImpl
{
if (!isGroupChatMessage(switchboard))
return;
-
+
try
{
AdHocChatRoomMsnImpl chatRoom
@@ -543,7 +546,7 @@ public class OperationSetAdHocMultiUserChatMsnImpl
{
chatRoom = createLocalAdHocChatRoomInstance(switchboard);
}
-
+
OperationSetPersistentPresenceMsnImpl presenceOpSet
= (OperationSetPersistentPresenceMsnImpl) provider
.getOperationSet(OperationSetPersistentPresence.class);
@@ -626,8 +629,8 @@ public class OperationSetAdHocMultiUserChatMsnImpl
*/
public void switchboardStarted(MsnSwitchboard switchboard)
{
- Object switchboardID = switchboard.getAttachment();
-
+ Object switchboardID = switchboard.getAttachment();
+
AdHocChatRoomMsnImpl adHocChatRoom = null;
if (switchboardID != null
&& pendingAdHocChatRoomList.containsKey(switchboardID))
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 e0700c4..3019f04 100644
--- a/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetAdHocMultiUserChatYahooImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetAdHocMultiUserChatYahooImpl.java
@@ -218,24 +218,24 @@ public class OperationSetAdHocMultiUserChatYahooImpl
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 class OperationSetAdHocMultiUserChatYahooImpl
}
}
- 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 @@ public class OperationSetAdHocMultiUserChatYahooImpl
YahooConference conference =
yahooProvider.getYahooSession().createConference(
invitedContacts, // users invited to this conference
- "", // invite message / topic
+ reason, // invite message / topic
yahooProvider.getYahooSession().getLoginIdentity());
chatRoom = createLocalChatRoomInstance(conference);