Adds property to disable private chat in chat rooms.

fix-message-formatting
Damian Minkov 12 years ago
parent 11b6b2aff4
commit c3416be7a8

@ -236,7 +236,9 @@ private void init()
}
else
{
this.add(this.sendPrivateMessageItem);
if(!ConfigurationUtils.isPrivateMessagingInChatRoomDisabled())
this.add(this.sendPrivateMessageItem);
if(room.getUserRole().getRoleIndex() >= 50)
{
if(roleIndex <= 40)

@ -17,6 +17,7 @@
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 void mouseClicked(MouseEvent e)
else if(e.getButton() == MouseEvent.BUTTON1
&& e.getClickCount() == 2)
{
if(ConfigurationUtils
.isPrivateMessagingInChatRoomDisabled())
return;
memberList.setSelectedIndex(
memberList.locationToIndex(e.getPoint()));

@ -101,6 +101,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.
*/
@ -511,6 +516,10 @@ public static void loadGuiConfigurations()
= 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";
@ -1100,6 +1109,20 @@ public static boolean isMultiChatWindowEnabled()
return isMultiChatWindowEnabled;
}
/**
* 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>.
@ -2687,6 +2710,12 @@ else if (evt.getPropertyName().equals(
{
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"))
{

Loading…
Cancel
Save