Added room and private message received hooks to test plugins
This commit is contained in:
@@ -90,6 +90,36 @@ prof_on_message_received(const char * const jid, const char *message)
|
||||
return result;
|
||||
}
|
||||
|
||||
char *
|
||||
prof_on_room_message_received(const char * const room, const char * const nick,
|
||||
const char *message)
|
||||
{
|
||||
char *start = "c-test: on_room_message_received, ";
|
||||
char buf[strlen(start) + strlen(room) + 2 + strlen(nick) + 2 + strlen(message) + 1];
|
||||
sprintf(buf, "%s%s, %s, %s", start, room, nick, message);
|
||||
prof_cons_show(buf);
|
||||
prof_cons_alert();
|
||||
char *result = malloc(strlen(message) + 4);
|
||||
sprintf(result, "%s%s", message, "[C]");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
char *
|
||||
prof_on_private_message_received(const char * const room, const char * const nick,
|
||||
const char *message)
|
||||
{
|
||||
char *start = "c-test: on_private_message_received, ";
|
||||
char buf[strlen(start) + strlen(room) + 2 + strlen(nick) + 2 + strlen(message) + 1];
|
||||
sprintf(buf, "%s%s, %s, %s", start, room, nick, message);
|
||||
prof_cons_show(buf);
|
||||
prof_cons_alert();
|
||||
char *result = malloc(strlen(message) + 4);
|
||||
sprintf(result, "%s%s", message, "[C]");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
char *
|
||||
prof_on_message_send(const char * const jid, const char *message)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user