express: Hook into callback for user changing nickname
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
fb4d13bd98
commit
7675357bdd
|
@ -299,3 +299,24 @@ _callback_user_private(Express_Network *net EINA_UNUSED, const char *event EINA_
|
|||
DBG("\t%s", params[2]);
|
||||
DBG("\t%s", params[3]);
|
||||
}
|
||||
|
||||
void
|
||||
_callback_user_nick(Express_Network *net EINA_UNUSED, const char *event EINA_UNUSED, const char *source, const char **params, unsigned int count, void *data EINA_UNUSED)
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
int crlf = 0, lf = 0;
|
||||
|
||||
crlf = _find_crlf(params[0], strlen(params[0]), &lf);
|
||||
if (crlf > 0)
|
||||
eina_strlcpy(buff, params[0], crlf + lf - 1);
|
||||
else
|
||||
eina_strlcpy(buff, params[0], strlen(params[0]) + 1);
|
||||
|
||||
DBG("User Changed Nick %s", buff);
|
||||
DBG("\tCount: %d", count);
|
||||
DBG("\tUser: %s", source);
|
||||
DBG("\tMessage:");
|
||||
DBG("\t%s", params[1]);
|
||||
DBG("\t%s", params[2]);
|
||||
DBG("\t%s", params[3]);
|
||||
}
|
||||
|
|
|
@ -15,5 +15,6 @@ void _callback_user_quit(Express_Network *net, const char *event, const char *so
|
|||
void _callback_user_part(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_nick(Express_Network *net, const char *event, const char *source, const char **params, unsigned int count, void *data);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -223,11 +223,11 @@ _cb_idle(void *data EINA_UNUSED)
|
|||
cbs.part = _callback_user_part;
|
||||
cbs.join = _callback_user_join;
|
||||
cbs.priv_msg = _callback_user_private;
|
||||
cbs.nick = _callback_user_nick;
|
||||
|
||||
/* TODO: Implement remaining callbacks
|
||||
*
|
||||
* NB: See src/lib/Express.h for callback comments */
|
||||
/* cbs.nick = ; */
|
||||
/* cbs.mode = ; */
|
||||
/* cbs.user_mode = ; */
|
||||
/* cbs.kick = ; */
|
||||
|
|
Loading…
Reference in New Issue