本文整理匯總了C++中EMIT_SIGNAL函數的典型用法代碼示例。如果您正苦於以下問題:C++ EMIT_SIGNAL函數的具體用法?C++ EMIT_SIGNAL怎麽用?C++ EMIT_SIGNAL使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EMIT_SIGNAL函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: inbound_open_dialog
static session *
inbound_open_dialog (server * serv, char *from)
{
session *sess;
sess = new_ircwindow (serv, from, SESS_DIALOG, 0);
/* for playing sounds */
EMIT_SIGNAL (XP_TE_OPENDIALOG, sess, NULL, NULL, NULL, NULL, 0);
return sess;
}
示例2: inbound_ping_reply
void
inbound_ping_reply (session * sess, char *timestring, char *from)
{
unsigned long tim, nowtim, dif;
int lag = 0;
char outbuf[64];
if (strncmp (timestring, "LAG", 3) == 0)
{
timestring += 3;
lag = 1;
}
tim = strtoul (timestring, NULL, 10);
nowtim = make_ping_time ();
dif = nowtim - tim;
sess->server->ping_recv = time (0);
if (lag)
{
sess->server->lag_sent = 0;
sess->server->lag = dif / 1000;
fe_set_lag (sess->server, dif / 100000);
return;
}
if (atol (timestring) == 0)
{
if (sess->server->lag_sent)
sess->server->lag_sent = 0;
else
EMIT_SIGNAL (XP_TE_PINGREP, sess, from, "?", NULL, NULL, 0);
}
else
{
snprintf (outbuf, sizeof (outbuf), "%ld.%ld%ld", dif / 1000000,
(dif / 100000) % 10, dif % 10);
EMIT_SIGNAL (XP_TE_PINGREP, sess, from, outbuf, NULL, NULL, 0);
}
}
示例3: inbound_next_nick
void
inbound_next_nick (session *sess, char *nick)
{
sess->server->nickcount++;
switch (sess->server->nickcount)
{
case 2:
sess->server->p_change_nick (sess->server, prefs.nick2);
EMIT_SIGNAL (XP_TE_NICKCLASH, sess, nick, prefs.nick2, NULL, NULL, 0);
break;
case 3:
sess->server->p_change_nick (sess->server, prefs.nick3);
EMIT_SIGNAL (XP_TE_NICKCLASH, sess, nick, prefs.nick3, NULL, NULL, 0);
break;
default:
EMIT_SIGNAL (XP_TE_NICKFAIL, sess, NULL, NULL, NULL, NULL, 0);
}
}
示例4: inbound_topictime
void
inbound_topictime (server *serv, char *chan, char *nick, time_t stamp)
{
char *tim = ctime (&stamp);
session *sess = find_channel (serv, chan);
if (!sess)
sess = serv->server_session;
tim[24] = 0; /* get rid of the \n */
EMIT_SIGNAL (XP_TE_TOPICDATE, sess, chan, nick, tim, NULL, 0);
}
示例5: inbound_sasl_authenticate
void
inbound_sasl_authenticate (server *serv, char *data)
{
ircnet *net = (ircnet*)serv->network;
char *user, *pass = NULL;
const char *mech = sasl_mechanisms[serv->sasl_mech];
/* Got a list of supported mechanisms from inspircd */
if (strchr (data, ',') != NULL)
{
inbound_sasl_supportedmechs (serv, data);
return;
}
if (net->user && !(net->flags & FLAG_USE_GLOBAL))
user = net->user;
else
user = prefs.hex_irc_user_name;
switch (serv->sasl_mech)
{
case MECH_PLAIN:
pass = encode_sasl_pass_plain (user, serv->password);
break;
#ifdef USE_OPENSSL
case MECH_BLOWFISH:
pass = encode_sasl_pass_blowfish (user, serv->password, data);
break;
case MECH_AES:
pass = encode_sasl_pass_aes (user, serv->password, data);
break;
case MECH_EXTERNAL:
pass = g_strdup ("+");
break;
#endif
}
if (pass == NULL)
{
/* something went wrong abort */
serv->sent_saslauth = TRUE; /* prevent trying PLAIN */
tcp_sendf (serv, "AUTHENTICATE *\r\n");
return;
}
serv->sent_saslauth = TRUE;
tcp_sendf (serv, "AUTHENTICATE %s\r\n", pass);
g_free (pass);
EMIT_SIGNAL (XP_TE_SASLAUTH, serv->server_session, user, (char*)mech);
}
示例6: do_dns
void
do_dns (session *sess, char *nick, char *host)
{
char *po;
char tbuf[1024];
po = strrchr (host, '@');
if (po)
host = po + 1;
EMIT_SIGNAL (XP_TE_RESOLVINGUSER, sess, nick, host, NULL, NULL, 0);
snprintf (tbuf, sizeof (tbuf), "exec -d %s %s", prefs.hex_dnsprogram, host);
handle_command (sess, tbuf, FALSE);
}
示例7: inbound_foundip
void
inbound_foundip (session *sess, char *ip)
{
struct hostent *HostAddr;
HostAddr = gethostbyname (ip);
if (HostAddr)
{
prefs.dcc_ip = ((struct in_addr *) HostAddr->h_addr)->s_addr;
EMIT_SIGNAL (XP_TE_FOUNDIP, sess,
inet_ntoa (*((struct in_addr *) HostAddr->h_addr)),
NULL, NULL, NULL, 0);
}
}
示例8: inbound_topic
void
inbound_topic (server * serv, char *chan, char *topic_text)
{
session *sess = find_channel (serv, chan);
if (sess)
{
set_topic (sess, topic_text, topic_text);
}
else
sess = serv->server_session;
EMIT_SIGNAL (XP_TE_TOPIC, sess, chan, topic_text, NULL, NULL, 0);
}
示例9: inbound_ujoin
void
inbound_ujoin (server *serv, char *chan, char *nick, char *ip)
{
session *sess;
/* already joined? probably a bnc */
sess = find_channel (serv, chan);
if (!sess)
{
/* see if a window is waiting to join this channel */
sess = find_session_from_waitchannel (chan, serv);
if (!sess)
{
/* find a "<none>" tab and use that */
sess = find_unused_session (serv);
if (!sess)
/* last resort, open a new tab/window */
sess = new_ircwindow (serv, chan, SESS_CHANNEL);
}
}
safe_strcpy (sess->channel, chan, CHANLEN);
fe_set_channel (sess);
fe_set_title (sess);
fe_set_nonchannel (sess, TRUE);
clear_user_list (sess);
if (prefs.logging)
log_open (sess);
sess->waitchannel[0] = 0;
sess->ignore_date = TRUE;
sess->ignore_mode = TRUE;
sess->ignore_names = TRUE;
sess->end_of_names = FALSE;
/* sends a MODE */
serv->p_join_info (sess->server, chan);
EMIT_SIGNAL (XP_TE_UJOIN, sess, nick, chan, ip, NULL, 0);
if (prefs.userhost)
{
/* sends WHO #channel */
serv->p_user_list (sess->server, chan);
sess->doing_who = TRUE;
}
}
示例10: inbound_ukick
void
inbound_ukick (server *serv, char *chan, char *kicker, char *reason)
{
session *sess = find_channel (serv, chan);
if (sess)
{
EMIT_SIGNAL (XP_TE_UKICK, sess, serv->nick, chan, kicker, reason, 0);
clear_channel (sess);
if (prefs.hex_irc_auto_rejoin)
{
serv->p_join (serv, chan, sess->channelkey);
safe_strcpy (sess->waitchannel, chan, CHANLEN);
}
}
}
示例11: inbound_topicnew
void
inbound_topicnew (server *serv, char *nick, char *chan, char *topic)
{
session *sess;
char *stripped_topic;
sess = find_channel (serv, chan);
if (sess)
{
EMIT_SIGNAL (XP_TE_NEWTOPIC, sess, nick, topic, chan, NULL, 0);
stripped_topic = strip_color (topic, -1, STRIP_ALL);
set_topic (sess, topic, stripped_topic);
g_free (stripped_topic);
}
}
示例12: inbound_away_notify
void
inbound_away_notify (server *serv, char *nick, char *reason)
{
session *sess = NULL;
GSList *list;
list = sess_list;
while (list)
{
sess = list->data;
if (sess->server == serv)
{
userlist_set_away (sess, nick, reason ? TRUE : FALSE);
if (sess == serv->front_session && notify_is_in_list (serv, nick))
{
if (reason)
EMIT_SIGNAL (XP_TE_NOTIFYAWAY, sess, nick, reason, NULL, NULL, 0);
else
EMIT_SIGNAL (XP_TE_NOTIFYBACK, sess, nick, NULL, NULL, NULL, 0);
}
}
list = list->next;
}
}
示例13: inbound_topicnew
void
inbound_topicnew (server *serv, char *nick, char *chan, char *topic)
{
session *sess;
char *new_topic;
sess = find_channel (serv, chan);
if (sess)
{
new_topic = strip_color (topic);
set_topic (sess, new_topic);
free (new_topic);
EMIT_SIGNAL (XP_TE_NEWTOPIC, sess, nick, topic, chan, NULL, 0);
}
}
示例14: inbound_topic
void
inbound_topic (server *serv, char *chan, char *topic_text)
{
session *sess = find_channel (serv, chan);
char *new_topic;
if (sess)
{
new_topic = strip_color (topic_text);
set_topic (sess, new_topic);
free (new_topic);
} else
sess = serv->server_session;
EMIT_SIGNAL (XP_TE_TOPIC, sess, chan, topic_text, NULL, NULL, 0);
}
示例15: notify_announce_offline
static void
notify_announce_offline (server * serv, struct notify_per_server *servnot,
char *nick, int quiet)
{
session *sess;
sess = serv->front_session;
servnot->ison = FALSE;
servnot->lastoff = time (0);
if (!quiet)
EMIT_SIGNAL (XP_TE_NOTIFYOFFLINE, sess, nick, serv->servername,
server_get_network (serv, TRUE), NULL, 0);
fe_notify_update (nick);
fe_notify_update (0);
}