aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2014-06-02 12:28:37 +0300
committerDamian Minkov <damencho@jitsi.org>2014-06-02 12:28:37 +0300
commitc3416be7a83f99f61e400a366ee4523d23d6a39b (patch)
tree480ff2d66894aa9850d86c4e01f8a15d427dcd91 /src
parent11b6b2aff4f875b88c7e8cd01f08206f760c2dfe (diff)
downloadjitsi-c3416be7a83f99f61e400a366ee4523d23d6a39b.zip
jitsi-c3416be7a83f99f61e400a366ee4523d23d6a39b.tar.gz
jitsi-c3416be7a83f99f61e400a366ee4523d23d6a39b.tar.bz2
Adds property to disable private chat in chat rooms.
Diffstat (limited to 'src')
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/ChatContactRightButtonMenu.java4
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomMemberListPanel.java5
-rw-r--r--src/net/java/sip/communicator/util/ConfigurationUtils.java29
3 files changed, 37 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatContactRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatContactRightButtonMenu.java
index 5e980d7..379a067 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatContactRightButtonMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatContactRightButtonMenu.java
@@ -236,7 +236,9 @@ public class ChatContactRightButtonMenu
}
else
{
- this.add(this.sendPrivateMessageItem);
+ if(!ConfigurationUtils.isPrivateMessagingInChatRoomDisabled())
+ this.add(this.sendPrivateMessageItem);
+
if(room.getUserRole().getRoleIndex() >= 50)
{
if(roleIndex <= 40)
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomMemberListPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomMemberListPanel.java
index df969e4..d3e950f 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomMemberListPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomMemberListPanel.java
@@ -17,6 +17,7 @@ import net.java.sip.communicator.impl.gui.main.contactlist.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.muc.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.skin.*;
/**
@@ -99,6 +100,10 @@ public class ChatRoomMemberListPanel
else if(e.getButton() == MouseEvent.BUTTON1
&& e.getClickCount() == 2)
{
+ if(ConfigurationUtils
+ .isPrivateMessagingInChatRoomDisabled())
+ return;
+
memberList.setSelectedIndex(
memberList.locationToIndex(e.getPoint()));
diff --git a/src/net/java/sip/communicator/util/ConfigurationUtils.java b/src/net/java/sip/communicator/util/ConfigurationUtils.java
index dc5cf47..0c8e00f 100644
--- a/src/net/java/sip/communicator/util/ConfigurationUtils.java
+++ b/src/net/java/sip/communicator/util/ConfigurationUtils.java
@@ -102,6 +102,11 @@ public class ConfigurationUtils
private static boolean isLeaveChatRoomOnWindowCloseEnabled;
/**
+ * Indicates if private messaging is enabled for chat rooms.
+ */
+ private static boolean isPrivateMessagingInChatRoomDisabled;
+
+ /**
* Indicates if the history should be shown in the chat window.
*/
private static boolean isHistoryShown;
@@ -511,6 +516,10 @@ public class ConfigurationUtils
= Boolean.parseBoolean(isMultiChatWindowEnabledString);
}
+ isPrivateMessagingInChatRoomDisabled
+ = configService.getBoolean(
+ "service.gui.IS_PRIVATE_CHAT_IN_CHATROOM_DISABLED", false);
+
// Load the "isLeaveChatroomOnWindowCloseEnabled" property.
String isLeaveChatRoomOnWindowCloseEnabledStringProperty
= "service.gui.LEAVE_CHATROOM_ON_WINDOW_CLOSE";
@@ -1101,6 +1110,20 @@ public class ConfigurationUtils
}
/**
+ * Returns <code>true</code> if the "isPrivateMessagingInChatRoomDisabled"
+ * property is true, otherwise - returns <code>false</code>.
+ * Indicates to the user interface whether the private messaging is disabled
+ * in chat rooms.
+ *
+ * @return <code>true</code> if the "isPrivateMessagingInChatRoomDisabled"
+ * property is true, otherwise - returns <code>false</code>.
+ */
+ public static boolean isPrivateMessagingInChatRoomDisabled()
+ {
+ return isPrivateMessagingInChatRoomDisabled;
+ }
+
+ /**
* Updates the "isMultiChatWindowEnabled" property through the
* <tt>ConfigurationService</tt>.
*
@@ -2688,6 +2711,12 @@ public class ConfigurationUtils
isMultiChatWindowEnabled = Boolean.parseBoolean(newValue);
}
else if (evt.getPropertyName().equals(
+ "service.gui.IS_PRIVATE_CHAT_IN_CHATROOM_DISABLED"))
+ {
+ isPrivateMessagingInChatRoomDisabled
+ = Boolean.parseBoolean(newValue);
+ }
+ else if (evt.getPropertyName().equals(
"service.gui.LEAVE_CHATROOM_ON_WINDOW_CLOSE"))
{
isLeaveChatRoomOnWindowCloseEnabled