From 92b397c9890d2da6d6cd6bfa724fc050adfcec36 Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Wed, 20 Jun 2007 13:24:53 +0000 Subject: 1. Added StringEscapeUtils 2. Added isContentTypeSupported and impl in BasicInstantMessaging OperationSets 3. Version in jabber version extension 4. Fix sending long messages in yahoo. --- .../OperationSetBasicInstantMessagingIcqImpl.java | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/net/java/sip/communicator/impl/protocol/icq') diff --git a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java index 409df02..d56fd74 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java @@ -32,9 +32,13 @@ import net.java.sip.communicator.service.protocol.aimconstants.*; public class OperationSetBasicInstantMessagingIcqImpl implements OperationSetBasicInstantMessaging { - private static final Logger logger = Logger.getLogger(OperationSetBasicInstantMessagingIcqImpl.class); + + /** + * HTML content type + */ + private static final String CONTENT_TYPE_HTML = "text/html"; /** * A list of listeneres registered for message events. @@ -373,6 +377,22 @@ public class OperationSetBasicInstantMessagingIcqImpl else return false; } + + /** + * Determines wheter the protocol supports the supplied content type + * + * @param contentType the type we want to check + * @return true if the protocol supports it and + * false otherwise. + */ + public boolean isContentTypeSupported(String contentType) + { + if(contentType.equals(DEFAULT_MIME_TYPE) || + (contentType.equals(CONTENT_TYPE_HTML) && !icqProvider.USING_ICQ) ) + return true; + else + return false; + } /** * Our listener that will tell us when we're registered to icq and joust @@ -533,6 +553,7 @@ public class OperationSetBasicInstantMessagingIcqImpl public void gotMessage(Conversation conversation, MessageInfo minfo) { String msgBody = minfo.getMessage().getMessageBody(); + if(logger.isDebugEnabled()) logger.debug("Received from " + conversation.getBuddy() @@ -547,7 +568,13 @@ public class OperationSetBasicInstantMessagingIcqImpl return; } - Message newMessage = createMessage(msgBody); + Message newMessage = null; + + if(icqProvider.USING_ICQ) + newMessage = createMessage(msgBody); + else + newMessage = createMessage(msgBody.getBytes(), + CONTENT_TYPE_HTML, DEFAULT_MIME_ENCODING, null); Contact sourceContact = opSetPersPresence.findContactByID( conversation.getBuddy() -- cgit v1.1