Adds a property to disable text displaying for some incoming and outgoing type of messages.

fix-message-formatting 5165
Damian Minkov 12 years ago
parent 4b029078c7
commit 8a0c43ff78

@ -506,7 +506,9 @@ else if (messageType.equals(Chat.SMS_MESSAGE))
contactDisplayName,
getContactAvatar(protocolProvider, contactAddress),
date,
formatMessage("SMS: " + message, contentType, keyword),
ConfigurationUtils.isSmsNotifyTextDisabled() ?
formatMessage(message, contentType, keyword)
: formatMessage("SMS: " + message, contentType, keyword),
contentType,
false,
isSimpleTheme);

@ -477,7 +477,8 @@ public void messageDelivered(MessageDeliveredEvent evt)
msg.getMessageUID(),
evt.getCorrectedMessageUID());
if(evt.isSmsMessage())
if(evt.isSmsMessage()
&& !ConfigurationUtils.isSmsNotifyTextDisabled())
{
chatPanel.addMessage(
contact.getDisplayName(),

@ -324,6 +324,18 @@ public class ConfigurationUtils
= "net.java.sip.communicator.impl.gui.contactlist" +
".HIDE_ADDRESS_IN_CALL_HISTORY_TOOLTIP_ENABLED";
/**
* Texts to notify that sms has been sent or sms has been received.
*/
private static boolean isSmsNotifyTextDisabled = false;
/**
* To disable displaying sms delivered message or sms received.
*/
private static final String SMS_MSG_NOTIFY_TEXT_DISABLED_PROP
= "net.java.sip.communicator.impl.gui.main.contactlist."
+ "SMS_MSG_NOTIFY_TEXT_DISABLED_PROP";
/**
* Whether domain will be shown in receive call dialog.
*/
@ -925,6 +937,11 @@ public static void loadGuiConfigurations()
hideExtendedAwayStatus = configService.getBoolean(
hideExtendedAwayStatusProperty,
hideExtendedAwayStatus);
isSmsNotifyTextDisabled = configService.getBoolean(
SMS_MSG_NOTIFY_TEXT_DISABLED_PROP,
isSmsNotifyTextDisabled
);
}
/**
@ -1800,6 +1817,16 @@ public static boolean isHideAddressInCallHistoryTooltipEnabled()
return isHideAddressInCallHistoryTooltipEnabled;
}
/**
* Whether to display or not the text notifying that a message is
* a incoming or outgoing sms message.
* @return whether to display the text notifying that a message is sms.
*/
public static boolean isSmsNotifyTextDisabled()
{
return isSmsNotifyTextDisabled;
}
/**
* Whether domain will be shown in receive call dialog.
* @return whether domain will be shown in receive call dialog.

Loading…
Cancel
Save