express: Delay channel creation until user has identified...
Also fix quit message...
This commit is contained in:
parent
f4f969feec
commit
367817b078
|
@ -41,10 +41,9 @@ _find_crlf(const char *data, int length, int *lf)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_callback_server_connected(Express_Network *net, const char *event EINA_UNUSED, const char *source, const char **params EINA_UNUSED, unsigned int count EINA_UNUSED, void *data EINA_UNUSED)
|
_callback_server_connected(Express_Network *net EINA_UNUSED, const char *event EINA_UNUSED, const char *source, const char **params EINA_UNUSED, unsigned int count EINA_UNUSED, void *data EINA_UNUSED)
|
||||||
{
|
{
|
||||||
DBG("Server %s Connected", source);
|
DBG("Server %s Connected", source);
|
||||||
_window_network_channels_create(net);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -265,7 +264,7 @@ _callback_user_quit(Express_Network *net EINA_UNUSED, const char *event EINA_UNU
|
||||||
/* DBG("\tMessage:"); */
|
/* DBG("\tMessage:"); */
|
||||||
/* DBG("\t%s", params[0]); */
|
/* DBG("\t%s", params[0]); */
|
||||||
|
|
||||||
snprintf(buff, sizeof(buff), "%s has %s", source, params[0]);
|
snprintf(buff, sizeof(buff), "%s has quit: %s", source, params[0]);
|
||||||
|
|
||||||
channels = _window_channels_user_find(source);
|
channels = _window_channels_user_find(source);
|
||||||
EINA_LIST_FOREACH(channels, l, chl)
|
EINA_LIST_FOREACH(channels, l, chl)
|
||||||
|
@ -340,13 +339,13 @@ _callback_user_private(Express_Network *net, const char *event EINA_UNUSED, cons
|
||||||
{
|
{
|
||||||
Channel * chl = NULL;
|
Channel * chl = NULL;
|
||||||
|
|
||||||
/* DBG("User Private %s", params[0]); */
|
DBG("User Private %s", params[0]);
|
||||||
/* DBG("\tCount: %d", count); */
|
DBG("\tCount: %d", count);
|
||||||
/* DBG("\tUser: %s", source); */
|
DBG("\tUser: %s", source);
|
||||||
/* DBG("\tMessage:"); */
|
DBG("\tMessage:");
|
||||||
/* DBG("\t%s", params[1]); // message */
|
DBG("\t%s", params[1]); // message
|
||||||
/* DBG("\t%s", params[2]); */
|
DBG("\t%s", params[2]);
|
||||||
/* DBG("\t%s", params[3]); */
|
DBG("\t%s", params[3]);
|
||||||
|
|
||||||
if (!(chl = _window_channel_find(source)))
|
if (!(chl = _window_channel_find(source)))
|
||||||
{
|
{
|
||||||
|
@ -396,3 +395,24 @@ _callback_user_nick(Express_Network *net EINA_UNUSED, const char *event EINA_UNU
|
||||||
_channel_text_append(chl, "*", buff,
|
_channel_text_append(chl, "*", buff,
|
||||||
_row_color_simple_create(COLOR_NICK_CHANGE));
|
_row_color_simple_create(COLOR_NICK_CHANGE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_callback_user_mode(Express_Network *net EINA_UNUSED, const char *event EINA_UNUSED, const char *source, const char **params, unsigned int count EINA_UNUSED, void *data EINA_UNUSED)
|
||||||
|
{
|
||||||
|
char user[PATH_MAX];
|
||||||
|
int crlf = 0, lf = 0;
|
||||||
|
|
||||||
|
crlf = _find_crlf(params[0], strlen(params[0]), &lf);
|
||||||
|
if (crlf > 0)
|
||||||
|
eina_strlcpy(user, params[0], crlf + lf - 1);
|
||||||
|
else
|
||||||
|
eina_strlcpy(user, params[0], strlen(params[0]) + 1);
|
||||||
|
|
||||||
|
/* DBG("User Mode %s", user); */
|
||||||
|
/* DBG("\tCount: %d", count); */
|
||||||
|
/* DBG("\tUser: %s", source); */
|
||||||
|
/* DBG("\tMessage:"); */
|
||||||
|
/* DBG("\t%s", params[1]); */
|
||||||
|
|
||||||
|
_window_network_channels_create(net);
|
||||||
|
}
|
||||||
|
|
|
@ -18,5 +18,6 @@ void _callback_user_part(Express_Network *net, const char *event, const char *so
|
||||||
void _callback_user_join(Express_Network *net, const char *event, const char *source, const char **params, unsigned int count, void *data);
|
void _callback_user_join(Express_Network *net, const char *event, const char *source, const char **params, unsigned int count, void *data);
|
||||||
void _callback_user_private(Express_Network *net, const char *event, const char *source, const char **params, unsigned int count, void *data);
|
void _callback_user_private(Express_Network *net, const char *event, const char *source, const char **params, unsigned int count, void *data);
|
||||||
void _callback_user_nick(Express_Network *net, const char *event, const char *source, const char **params, unsigned int count, void *data);
|
void _callback_user_nick(Express_Network *net, const char *event, const char *source, const char **params, unsigned int count, void *data);
|
||||||
|
void _callback_user_mode(Express_Network *net EINA_UNUSED, const char *event EINA_UNUSED, const char *source, const char **params, unsigned int count EINA_UNUSED, void *data EINA_UNUSED);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue