Skip to content

Commit

Permalink
Modified text_emit and text_emit_by_name to handle 5 parameters
Browse files Browse the repository at this point in the history
Modified EMIT_SIGNAL_TIMESTAMP and EMIT_SIGNAL to handle 5 parameters
  • Loading branch information
Derp Derpingston committed May 12, 2014
1 parent 7218029 commit c6852af
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
19 changes: 15 additions & 4 deletions src/common/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,14 @@ static char * const pevt_chanmsg_help[] = {
N_("Identified text"),
};

static char * const pevt_pchanmsg_help[] = {
N_("Nickname"),
N_("The text"),
N_("Mode char"),
N_("Identified text"),
N_("Prefix char"),
};

static char * const pevt_privmsg_help[] = {
N_("Nickname"),
N_("The message"),
Expand Down Expand Up @@ -2097,7 +2105,7 @@ text_color_of (char *name)
/* called by EMIT_SIGNAL macro */

void
text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
text_emit (int index, session *sess, char *a, char *b, char *c, char *d, char *e,
time_t timestamp)
{
char *word[PDIWORDS];
Expand All @@ -2117,7 +2125,8 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
word[2] = (b ? b : "\000");
word[3] = (c ? c : "\000");
word[4] = (d ? d : "\000");
for (i = 5; i < PDIWORDS; i++)
word[5] = (e ? e : "\000");
for (i = 6; i < PDIWORDS; i++)
word[i] = "\000";

if (plugin_emit_print (sess, word, timestamp))
Expand Down Expand Up @@ -2155,6 +2164,7 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
/* ===Highlighted message=== */
case XP_TE_HCHANACTION:
case XP_TE_HCHANMSG:
case XP_TE_HPCHANMSG:
if (chanopt_is_set (prefs.hex_input_beep_hilight, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
sound_beep (sess);
if (chanopt_is_set (prefs.hex_input_flash_hilight, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
Expand All @@ -2166,6 +2176,7 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
/* ===Channel message=== */
case XP_TE_CHANACTION:
case XP_TE_CHANMSG:
case XP_TE_PCHANMSG:
if (chanopt_is_set (prefs.hex_input_beep_chans, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
sound_beep (sess);
if (chanopt_is_set (prefs.hex_input_flash_chans, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
Expand Down Expand Up @@ -2193,14 +2204,14 @@ text_find_format_string (char *name)

int
text_emit_by_name (char *name, session *sess, time_t timestamp,
char *a, char *b, char *c, char *d)
char *a, char *b, char *c, char *d, char *e)
{
int i = 0;

i = pevent_find (name, &i);
if (i >= 0)
{
text_emit (i, sess, a, b, c, d, timestamp);
text_emit (i, sess, a, b, c, d, e, timestamp);
return 1;
}

Expand Down
8 changes: 4 additions & 4 deletions src/common/text.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

/* timestamp is non-zero if we are using server-time */
#define EMIT_SIGNAL_TIMESTAMP(i, sess, a, b, c, d, e, timestamp) \
text_emit(i, sess, a, b, c, d, timestamp)
text_emit(i, sess, a, b, c, d, e, timestamp)
#define EMIT_SIGNAL(i, sess, a, b, c, d, e) \
text_emit(i, sess, a, b, c, d, 0)
text_emit(i, sess, a, b, c, d, e, 0)

struct text_event
{
Expand All @@ -53,10 +53,10 @@ int pevt_build_string (const char *input, char **output, int *max_arg);
int pevent_load (char *filename);
void pevent_make_pntevts (void);
int text_color_of (char *name);
void text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
void text_emit (int index, session *sess, char *a, char *b, char *c, char *d, char *e,
time_t timestamp);
int text_emit_by_name (char *name, session *sess, time_t timestamp,
char *a, char *b, char *c, char *d);
char *a, char *b, char *c, char *d, char *e);
char *text_validate (char **text, int *len);
int get_stamp_str (char *fmt, time_t tim, char **ret);
void format_event (session *sess, int index, char **args, char *o, int sizeofo, unsigned int stripcolor_args);
Expand Down

0 comments on commit c6852af

Please sign in to comment.