diff options
author | Damian Minkov <damencho@jitsi.org> | 2013-12-20 16:31:22 +0200 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2014-01-07 11:50:01 +0200 |
commit | 051e3f817a2ca9026d65ee3f6b608de08ca52b34 (patch) | |
tree | 77801b499e0b53ccfd08de8d7356f056154a69eb /src/net/java | |
parent | cbd25f3a73bc200831d248607df50ca3c2f74ff9 (diff) | |
download | jitsi-051e3f817a2ca9026d65ee3f6b608de08ca52b34.zip jitsi-051e3f817a2ca9026d65ee3f6b608de08ca52b34.tar.gz jitsi-051e3f817a2ca9026d65ee3f6b608de08ca52b34.tar.bz2 |
Removes MUCService dependence from desktoputil plugin.
Diffstat (limited to 'src/net/java')
4 files changed, 26 insertions, 32 deletions
diff --git a/src/net/java/sip/communicator/impl/muc/MUCCustomContactActionService.java b/src/net/java/sip/communicator/impl/muc/MUCCustomContactActionService.java index 2498654..3ce9190 100644 --- a/src/net/java/sip/communicator/impl/muc/MUCCustomContactActionService.java +++ b/src/net/java/sip/communicator/impl/muc/MUCCustomContactActionService.java @@ -185,7 +185,10 @@ public class MUCCustomContactActionService joinOptions = ChatRoomJoinOptionsDialog.getJoinOptions(
chatRoomWrapper.getParentProvider()
.getProtocolProvider(),
- chatRoomWrapper.getChatRoomID());
+ chatRoomWrapper.getChatRoomID(),
+ MUCActivator.getMUCService().getDefaultNickname(
+ chatRoomWrapper.getParentProvider()
+ .getProtocolProvider()));
nickName = joinOptions[0];
subject = joinOptions[1];
}
@@ -204,7 +207,10 @@ public class MUCCustomContactActionService String[] joinOptions;
joinOptions = ChatRoomJoinOptionsDialog.getJoinOptions(
chatRoomWrapper.getParentProvider().getProtocolProvider(),
- chatRoomWrapper.getChatRoomID());
+ chatRoomWrapper.getChatRoomID(),
+ MUCActivator.getMUCService().getDefaultNickname(
+ chatRoomWrapper.getParentProvider()
+ .getProtocolProvider()));
if(joinOptions[0] == null)
return;
MUCActivator.getMUCService()
@@ -244,7 +250,10 @@ public class MUCCustomContactActionService {
ChatRoomJoinOptionsDialog.getJoinOptions(true,
chatRoomWrapper.getParentProvider().getProtocolProvider(),
- chatRoomWrapper.getChatRoomID());
+ chatRoomWrapper.getChatRoomID(),
+ MUCActivator.getMUCService().getDefaultNickname(
+ chatRoomWrapper.getParentProvider()
+ .getProtocolProvider()));
}
},
autoJoinRunnable,
diff --git a/src/net/java/sip/communicator/impl/muc/MUCServiceImpl.java b/src/net/java/sip/communicator/impl/muc/MUCServiceImpl.java index 0dc9b5b..7b01948 100644 --- a/src/net/java/sip/communicator/impl/muc/MUCServiceImpl.java +++ b/src/net/java/sip/communicator/impl/muc/MUCServiceImpl.java @@ -1012,7 +1012,9 @@ public class MUCServiceImpl {
String[] joinOptions = ChatRoomJoinOptionsDialog.getJoinOptions(
room.getParentProvider().getProtocolProvider(),
- room.getChatRoomID());
+ room.getChatRoomID(),
+ getDefaultNickname(
+ room.getParentProvider().getProtocolProvider()));
savedNick = joinOptions[0];
subject = joinOptions[1];
diff --git a/src/net/java/sip/communicator/plugin/desktoputil/DesktopUtilActivator.java b/src/net/java/sip/communicator/plugin/desktoputil/DesktopUtilActivator.java index 780f82c..1a8270e 100644 --- a/src/net/java/sip/communicator/plugin/desktoputil/DesktopUtilActivator.java +++ b/src/net/java/sip/communicator/plugin/desktoputil/DesktopUtilActivator.java @@ -13,7 +13,6 @@ import net.java.sip.communicator.service.credentialsstorage.*; import net.java.sip.communicator.service.globaldisplaydetails.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.keybindings.*; -import net.java.sip.communicator.service.muc.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.resources.*; import net.java.sip.communicator.util.*; @@ -58,8 +57,6 @@ public class DesktopUtilActivator static BundleContext bundleContext; - private static MUCService mucService; - /** * Calls <tt>Thread.setUncaughtExceptionHandler()</tt> * @@ -349,21 +346,4 @@ public class DesktopUtilActivator } return globalDisplayDetailsService; } - - /** - * Returns the <tt>MUCService</tt> obtained from the bundle context. - * - * @return the <tt>MUCService</tt> obtained from the bundle context - */ - public static MUCService getMUCService() - { - if (mucService == null) - { - mucService - = ServiceUtils.getService( - bundleContext, - MUCService.class); - } - return mucService; - } -}
\ No newline at end of file +} diff --git a/src/net/java/sip/communicator/plugin/desktoputil/chat/ChatRoomJoinOptionsDialog.java b/src/net/java/sip/communicator/plugin/desktoputil/chat/ChatRoomJoinOptionsDialog.java index 81f13ba..51d62cb 100644 --- a/src/net/java/sip/communicator/plugin/desktoputil/chat/ChatRoomJoinOptionsDialog.java +++ b/src/net/java/sip/communicator/plugin/desktoputil/chat/ChatRoomJoinOptionsDialog.java @@ -124,12 +124,13 @@ public class ChatRoomJoinOptionsDialog extends ChatOperationReasonDialog *
* @param pps the protocol provider associated with the chat room.
* @param chatRoomId the id of the chat room.
+ * @param defaultNickname the nickname to show if any
* @return array with the nickname and subject values.
*/
public static String[] getJoinOptions(ProtocolProviderService pps,
- String chatRoomId)
+ String chatRoomId, String defaultNickname)
{
- return getJoinOptions(false, pps, chatRoomId);
+ return getJoinOptions(false, pps, chatRoomId, defaultNickname);
}
/**
@@ -137,10 +138,13 @@ public class ChatRoomJoinOptionsDialog extends ChatOperationReasonDialog * and returns them.
*
* @param dontDisplaySubjectFields if true the subject fields will be hidden
+ * @param pps the protocol provider associated with the chat room.
+ * @param chatRoomId the id of the chat room.
+ * @param defaultNickname the nickname to show if any
* @return array with the nickname and subject values.
*/
public static String[] getJoinOptions(boolean dontDisplaySubjectFields,
- ProtocolProviderService pps, String chatRoomId)
+ ProtocolProviderService pps, String chatRoomId, String defaultNickname)
{
String nickName = null;
ChatRoomJoinOptionsDialog reasonDialog =
@@ -151,10 +155,9 @@ public class ChatRoomJoinOptionsDialog extends ChatOperationReasonDialog dontDisplaySubjectFields);
reasonDialog.setIcon(new ImageIcon(DesktopUtilActivator.getImage(
"service.gui.icons.CHANGE_NICKNAME_16x16")));
-
-
- reasonDialog.setReasonFieldText(
- DesktopUtilActivator.getMUCService().getDefaultNickname(pps));
+
+ if(defaultNickname != null)
+ reasonDialog.setReasonFieldText(defaultNickname);
int result = reasonDialog.showDialog();
|