diff src/protocols/sametime/sametime.c @ 12216:4d3119205a33

[gaim-migrate @ 14518] Remove GaimConvImFlags and GaimConvChatFlags - use GaimMessageFlags everywhere instead. Add a new GAIM_MESSAGE_IMAGES flag, and set it when sending a message containing images. When sending a message, the core will now always send "html" to the prpls, just like it expects to receive html from the prpls for received messages. This will allow text prpls such as SILC to support IM images and differentiate them from user input. Previously gaim_unescape_html() was used before passing the message to the prpl, now the prpl does this itself if it needs it. I think I updated all the prpls correctly, but I'm not so sure about sametime. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 24 Nov 2005 20:47:46 +0000
parents d6417efb990c
children 8190a70d2c34
line wrap: on
line diff
--- a/src/protocols/sametime/sametime.c	Thu Nov 24 20:38:24 2005 +0000
+++ b/src/protocols/sametime/sametime.c	Thu Nov 24 20:47:46 2005 +0000
@@ -3908,7 +3908,7 @@
 static int mw_prpl_send_im(GaimConnection *gc,
 			   const char *name,
 			   const char *message,
-			   GaimConvImFlags flags) {
+			   GaimMessageFlags flags) {
 
   struct mwGaimPluginData *pd;
   struct mwIdBlock who = { (char *) name, NULL };
@@ -3930,13 +3930,13 @@
      which is bad. I'm not sure how to fix this correctly. */
 
   if(strstr(message, "<img ") || strstr(message, "<IMG "))
-    flags |= GAIM_CONV_IM_IMAGES;
+    flags |= GAIM_MESSAGE_IMAGES;
 
   if(mwConversation_isOpen(conv)) {
     char *tmp;
     int ret;
 
-    if((flags & GAIM_CONV_IM_IMAGES) &&
+    if((flags & GAIM_MESSAGE_IMAGES) &&
        mwConversation_supports(conv, mwImSend_MIME)) {
       /* send a MIME message */
 
@@ -3964,7 +3964,9 @@
 
     } else {
       /* default to text */
-      ret = mwConversation_send(conv, mwImSend_PLAIN, message);
+	  tmp = gaim_unescape_html(message);
+      ret = mwConversation_send(conv, mwImSend_PLAIN, tmp);
+	  g_free(tmp);
     }
     
     return !ret;
@@ -4797,7 +4799,8 @@
 
 static int mw_prpl_chat_send(GaimConnection *gc,
 			     int id,
-			     const char *message) {
+			     const char *message,
+				 GaimMessageFlags flags) {
 
   struct mwGaimPluginData *pd;
   struct mwConference *conf;