Added message sending hooks to test plugins
This commit is contained in:
12
RubyTest.rb
12
RubyTest.rb
@@ -47,6 +47,18 @@ module RubyTest
|
||||
return message + "[RUBY]"
|
||||
end
|
||||
|
||||
def self.prof_on_private_message_send(room, nick, message)
|
||||
Prof::cons_show("RubyTest: on_private_message_send, " + room + ", " + nick + ", " + message)
|
||||
Prof::cons_alert
|
||||
return message + "[RUBY]"
|
||||
end
|
||||
|
||||
def self.prof_on_room_message_send(room, message)
|
||||
Prof::cons_show("RubyTest: on_room_message_send, " + room + ", " + message)
|
||||
Prof::cons_alert
|
||||
return message + "[RUBY]"
|
||||
end
|
||||
|
||||
def self.prof_on_shutdown()
|
||||
Prof::log_info("RubyTest: on_shutdown");
|
||||
end
|
||||
|
||||
@@ -39,6 +39,16 @@ def prof_on_message_send(jid, message):
|
||||
prof.cons_alert()
|
||||
return message + "[PYTHON]"
|
||||
|
||||
def prof_on_private_message_send(room, nick, message):
|
||||
prof.cons_show("python-test: on_private_message_send, " + room + ", " + nick + ", " + message)
|
||||
prof.cons_alert()
|
||||
return message + "[PYTHON]"
|
||||
|
||||
def prof_on_room_message_send(room, message):
|
||||
prof.cons_show("python-test: on_room_message_send, " + room + ", " + message)
|
||||
prof.cons_alert()
|
||||
return message + "[PYTHON]"
|
||||
|
||||
def prof_on_shutdown():
|
||||
prof.log_info("python-test: on_shutdown")
|
||||
|
||||
|
||||
@@ -134,6 +134,35 @@ prof_on_message_send(const char * const jid, const char *message)
|
||||
return result;
|
||||
}
|
||||
|
||||
char *
|
||||
prof_on_private_message_send(const char * const room, const char * const nick,
|
||||
const char *message)
|
||||
{
|
||||
char *start = "c-test: on_private_message_send, ";
|
||||
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_room_message_send(const char * const room, const char *message)
|
||||
{
|
||||
char *start = "c-test: on_room_message_send, ";
|
||||
char buf[strlen(start) + strlen(room) + 2 + strlen(message) + 1];
|
||||
sprintf(buf, "%s%s, %s", start, room, message);
|
||||
prof_cons_show(buf);
|
||||
prof_cons_alert();
|
||||
char *result = malloc(strlen(message) + 4);
|
||||
sprintf(result, "%s%s", message, "[C]");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
prof_on_shutdown(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user