aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/protocol/icq
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2007-06-20 13:24:53 +0000
committerDamian Minkov <damencho@jitsi.org>2007-06-20 13:24:53 +0000
commit92b397c9890d2da6d6cd6bfa724fc050adfcec36 (patch)
tree0a37ddb7b4244519a96e3004e7c33e13af3e096e /src/net/java/sip/communicator/impl/protocol/icq
parenta634000fb534e9dd8bf7ab94852a9330db1276fa (diff)
downloadjitsi-92b397c9890d2da6d6cd6bfa724fc050adfcec36.zip
jitsi-92b397c9890d2da6d6cd6bfa724fc050adfcec36.tar.gz
jitsi-92b397c9890d2da6d6cd6bfa724fc050adfcec36.tar.bz2
1. Added StringEscapeUtils
2. Added isContentTypeSupported and impl in BasicInstantMessaging OperationSets 3. Version in jabber version extension 4. Fix sending long messages in yahoo.
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol/icq')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java31
1 files changed, 29 insertions, 2 deletions
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 <tt>true</tt> if the protocol supports it and
+ * <tt>false</tt> 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()