diff mcabber/src/jabglue.c @ 1305:9bc68473f8a3

-n and -f flags to message-sending commands Allows sending normal and headline messages
author Michal 'vorner' Vaner <vorner@ucw.cz>
date Sat, 08 Sep 2007 13:21:07 +0200
parents 8ada97e5eb75
children a7d21918234c
line wrap: on
line diff
--- a/mcabber/src/jabglue.c	Fri Sep 07 17:07:35 2007 +0200
+++ b/mcabber/src/jabglue.c	Sat Sep 08 13:21:07 2007 +0200
@@ -557,10 +557,11 @@
 // message has been PGP-encrypted.  If encryption enforcement is set and
 // encryption fails, *encrypted is set to -1.
 void jb_send_msg(const char *fjid, const char *text, int type,
-                 const char *subject, const char *msgid, gint *encrypted)
+                 const char *subject, const char *msgid, gint *encrypted,
+                 const char *type_overwrite)
 {
   xmlnode x;
-  gchar *strtype;
+  const gchar *strtype;
 #ifdef HAVE_LIBOTR
   int otr_msg = 0;
 #endif
@@ -583,10 +584,14 @@
 
   if (!online) return;
 
-  if (type == ROSTER_TYPE_ROOM)
-    strtype = TMSG_GROUPCHAT;
-  else
-    strtype = TMSG_CHAT;
+  if (type_overwrite)
+    strtype = type_overwrite;
+  else {
+    if (type == ROSTER_TYPE_ROOM)
+      strtype = TMSG_GROUPCHAT;
+    else
+      strtype = TMSG_CHAT;
+  }
 
 #if defined HAVE_GPGME || defined HAVE_LIBOTR || defined JEP0022 || defined JEP0085
   rname = strchr(fjid, JID_RESOURCE_SEPARATOR);