mirror of
https://github.com/irssi/irssi.git
synced 2026-08-17 15:42:26 +02:00
command() doesn't need cmdchar at start of command anymore.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@937 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
c8a90566ca
commit
b3a642e548
2 changed files with 20 additions and 4 deletions
|
|
@ -30,6 +30,7 @@
|
|||
#include "module.h"
|
||||
#include "modules.h"
|
||||
#include "signals.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include "chat-protocols.h"
|
||||
#include "servers.h"
|
||||
|
|
@ -189,6 +190,21 @@ void printformat_perl(TEXT_DEST_REC *dest, char *format, char **arglist)
|
|||
g_free(module);
|
||||
}
|
||||
|
||||
void perl_command(const char *cmd, SERVER_REC *server, WI_ITEM_REC *item)
|
||||
{
|
||||
const char *cmdchars;
|
||||
char *sendcmd = (char *) cmd;
|
||||
|
||||
cmdchars = settings_get_str("cmdchars");
|
||||
if (strchr(cmdchars, *cmd) == NULL) {
|
||||
/* no command char - let's put it there.. */
|
||||
sendcmd = g_strdup_printf("%c%s", *cmdchars, cmd);
|
||||
}
|
||||
|
||||
signal_emit("send command", 3, cmd, server, item);
|
||||
if (sendcmd != cmd) g_free(sendcmd);
|
||||
}
|
||||
|
||||
static void perl_register_protocol(CHAT_PROTOCOL_REC *rec)
|
||||
{
|
||||
static char *items[] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue