diff mcabber/src/hooks.c @ 967:303408ef5e5d

Configurable command character This patch sets the command character as a configurable compile time option.
author Alexis Hildebrandt
date Fri, 29 Sep 2006 20:28:20 +0200
parents df4bb1535ef8
children 54405d09b15a
line wrap: on
line diff
--- a/mcabber/src/hooks.c	Thu Sep 28 21:36:58 2006 +0200
+++ b/mcabber/src/hooks.c	Fri Sep 29 20:28:20 2006 +0200
@@ -57,10 +57,10 @@
       bmsg = g_strdup_printf("<%s> %s", resname, msg);
     }
     wmsg = bmsg;
-    if (!strncmp(msg, "/me ", 4))
+    if (!strncmp(msg, mkcmdstr("me "), strlen(mkcmdstr("me "))))
       wmsg = mmsg = g_strdup_printf("*%s %s", resname, msg+4);
   } else {
-    if (!strncmp(msg, "/me ", 4))
+    if (!strncmp(msg, mkcmdstr("me "), strlen(mkcmdstr("me "))))
       wmsg = mmsg = g_strdup_printf("*%s %s", jid, msg+4);
     else
       wmsg = (char*) msg;
@@ -92,7 +92,7 @@
         wmsg = bmsg = g_strdup(msg);
       } else {
         wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", resname, msg);
-        if (!strncmp(msg, "/me ", 4))
+        if (!strncmp(msg, mkcmdstr("me "), strlen(mkcmdstr("me "))))
           wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4);
       }
     } else {
@@ -174,7 +174,7 @@
     wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", nick, msg);
   } else {
     wmsg = (char*)msg;
-    if (!strncmp(msg, "/me ", 4)) {
+    if (!strncmp(msg, mkcmdstr("me "), strlen(mkcmdstr("me ")))) {
       const char *myid = settings_opt_get("username");
       if (myid)
         wmsg = mmsg = g_strdup_printf("*%s %s", settings_opt_get("username"),