comparison 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
comparison
equal deleted inserted replaced
966:d9acb7f2a3d1 967:303408ef5e5d
55 bmsg = g_strdup_printf("~ %s", msg); 55 bmsg = g_strdup_printf("~ %s", msg);
56 } else { 56 } else {
57 bmsg = g_strdup_printf("<%s> %s", resname, msg); 57 bmsg = g_strdup_printf("<%s> %s", resname, msg);
58 } 58 }
59 wmsg = bmsg; 59 wmsg = bmsg;
60 if (!strncmp(msg, "/me ", 4)) 60 if (!strncmp(msg, mkcmdstr("me "), strlen(mkcmdstr("me "))))
61 wmsg = mmsg = g_strdup_printf("*%s %s", resname, msg+4); 61 wmsg = mmsg = g_strdup_printf("*%s %s", resname, msg+4);
62 } else { 62 } else {
63 if (!strncmp(msg, "/me ", 4)) 63 if (!strncmp(msg, mkcmdstr("me "), strlen(mkcmdstr("me "))))
64 wmsg = mmsg = g_strdup_printf("*%s %s", jid, msg+4); 64 wmsg = mmsg = g_strdup_printf("*%s %s", jid, msg+4);
65 else 65 else
66 wmsg = (char*) msg; 66 wmsg = (char*) msg;
67 } 67 }
68 68
90 if (!resname) { 90 if (!resname) {
91 resname = ""; 91 resname = "";
92 wmsg = bmsg = g_strdup(msg); 92 wmsg = bmsg = g_strdup(msg);
93 } else { 93 } else {
94 wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", resname, msg); 94 wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", resname, msg);
95 if (!strncmp(msg, "/me ", 4)) 95 if (!strncmp(msg, mkcmdstr("me "), strlen(mkcmdstr("me "))))
96 wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4); 96 wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4);
97 } 97 }
98 } else { 98 } else {
99 // This is a regular chatroom message. 99 // This is a regular chatroom message.
100 // Let's see if we are the message sender, in which case we'll 100 // Let's see if we are the message sender, in which case we'll
172 172
173 if (nick) { 173 if (nick) {
174 wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", nick, msg); 174 wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", nick, msg);
175 } else { 175 } else {
176 wmsg = (char*)msg; 176 wmsg = (char*)msg;
177 if (!strncmp(msg, "/me ", 4)) { 177 if (!strncmp(msg, mkcmdstr("me "), strlen(mkcmdstr("me ")))) {
178 const char *myid = settings_opt_get("username"); 178 const char *myid = settings_opt_get("username");
179 if (myid) 179 if (myid)
180 wmsg = mmsg = g_strdup_printf("*%s %s", settings_opt_get("username"), 180 wmsg = mmsg = g_strdup_printf("*%s %s", settings_opt_get("username"),
181 msg+4); 181 msg+4);
182 } 182 }