Modified default chat room auto-open behaviour to OPEN_ON_MESSAGE.

fix-message-formatting 5282
Danny van Heumen 11 years ago
parent 29953c199f
commit 9be99cdeb2

@ -228,7 +228,7 @@ private void refreshValue()
propertyListener); propertyListener);
if(value == null) if(value == null)
value = MUCService.OPEN_ON_IMPORTANT_MESSAGE; value = MUCService.DEFAULT_AUTO_OPEN_BEHAVIOUR;
if(value.equals(MUCService.OPEN_ON_ACTIVITY)) if(value.equals(MUCService.OPEN_ON_ACTIVITY))
{ {

@ -24,9 +24,8 @@
import net.java.sip.communicator.util.*; import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.Logger; import net.java.sip.communicator.util.Logger;
import org.jitsi.util.*;
import org.jdesktop.swingworker.SwingWorker; import org.jdesktop.swingworker.SwingWorker;
import org.jitsi.util.*;
import org.osgi.framework.*; import org.osgi.framework.*;
/** /**
@ -214,7 +213,7 @@ public void messageReceived(ChatRoomMessageReceivedEvent evt)
sourceChatRoom.getParentProvider(), sourceChatRoom.getParentProvider(),
sourceChatRoom.getIdentifier()); sourceChatRoom.getIdentifier());
if(autoOpenConfig == null) if(autoOpenConfig == null)
autoOpenConfig = MUCService.OPEN_ON_IMPORTANT_MESSAGE; autoOpenConfig = MUCService.DEFAULT_AUTO_OPEN_BEHAVIOUR;
if(autoOpenConfig.equals(MUCService.OPEN_ON_ACTIVITY) if(autoOpenConfig.equals(MUCService.OPEN_ON_ACTIVITY)
|| (autoOpenConfig.equals(MUCService.OPEN_ON_MESSAGE) || (autoOpenConfig.equals(MUCService.OPEN_ON_MESSAGE)

@ -8,8 +8,6 @@
import java.util.*; import java.util.*;
import org.jitsi.service.resources.*;
import net.java.sip.communicator.plugin.desktoputil.chat.*; import net.java.sip.communicator.plugin.desktoputil.chat.*;
import net.java.sip.communicator.service.contactsource.*; import net.java.sip.communicator.service.contactsource.*;
import net.java.sip.communicator.service.customcontactactions.*; import net.java.sip.communicator.service.customcontactactions.*;
@ -17,6 +15,8 @@
import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*; import net.java.sip.communicator.util.*;
import org.jitsi.service.resources.*;
/** /**
* Implements <tt>CustomContactActionsService</tt> for MUC contact source. * Implements <tt>CustomContactActionsService</tt> for MUC contact source.
* *
@ -643,7 +643,7 @@ public String getText(SourceContact actionSource)
((ChatRoomSourceContact)actionSource).getProvider(), ((ChatRoomSourceContact)actionSource).getProvider(),
((ChatRoomSourceContact)actionSource).getChatRoomID()); ((ChatRoomSourceContact)actionSource).getChatRoomID());
if(openAutomaticallyValue == null) if(openAutomaticallyValue == null)
openAutomaticallyValue = MUCService.OPEN_ON_IMPORTANT_MESSAGE; openAutomaticallyValue = MUCService.DEFAULT_AUTO_OPEN_BEHAVIOUR;
String openAutomaticallyKey = MUCService.autoOpenConfigValuesTexts String openAutomaticallyKey = MUCService.autoOpenConfigValuesTexts
.get(openAutomaticallyValue); .get(openAutomaticallyValue);
return "<html>" + text + "...<br><font size=\"2\"><center> (" return "<html>" + text + "...<br><font size=\"2\"><center> ("

@ -26,6 +26,11 @@ public abstract class MUCService
public static final String DISABLED_PROPERTY public static final String DISABLED_PROPERTY
= "net.java.sip.communicator.impl.muc.MUC_SERVICE_DISABLED"; = "net.java.sip.communicator.impl.muc.MUC_SERVICE_DISABLED";
/**
* Key for auto-open configuration entry.
*/
private static String AUTO_OPEN_CONFIG_KEY = "openAutomatically";
/** /**
* The value for chat room configuration property to open automatically on * The value for chat room configuration property to open automatically on
* activity * activity
@ -44,6 +49,11 @@ public abstract class MUCService
*/ */
public static String OPEN_ON_IMPORTANT_MESSAGE = "on_important_message"; public static String OPEN_ON_IMPORTANT_MESSAGE = "on_important_message";
/**
* The default for chat room auto-open behaviour.
*/
public static String DEFAULT_AUTO_OPEN_BEHAVIOUR = OPEN_ON_MESSAGE;
/** /**
* Map for the auto open configuration values and their text representation * Map for the auto open configuration values and their text representation
*/ */
@ -73,7 +83,7 @@ public static void setChatRoomAutoOpenOption(
{ {
ConfigurationUtils.updateChatRoomProperty( ConfigurationUtils.updateChatRoomProperty(
pps, pps,
chatRoomId, "openAutomatically", value); chatRoomId, AUTO_OPEN_CONFIG_KEY, value);
} }
/** /**
@ -88,7 +98,7 @@ public static String getChatRoomAutoOpenOption(
{ {
return ConfigurationUtils.getChatRoomProperty( return ConfigurationUtils.getChatRoomProperty(
pps, pps,
chatRoomId, "openAutomatically"); chatRoomId, AUTO_OPEN_CONFIG_KEY);
} }
/** /**

Loading…
Cancel
Save