summary refs log tree commit diff stats
path: root/src/common/hexchat-plugin.h
diff options
context:
space:
mode:
authorDiogo Sousa <diogogsousa@gmail.com>2013-07-09 20:21:16 +0100
committerDiogo Sousa <diogogsousa@gmail.com>2013-07-09 20:21:16 +0100
commit798db7368a2df832924be1f28c9720ae6bc60236 (patch)
treeecc1d602507e7694f43054a6d27d10c514433ea3 /src/common/hexchat-plugin.h
parent1544a5d6cb4e44af23c0c2354d0fc6cb1b404460 (diff)
Added hexchat_hook_server_attrs() and hexchat_hook_print_attrs() to the plugin
interface. This hooks are similar to hexchat_hook_{server,print}() except the
callback passes an extra argument with the (new) structure hexchat_event_attrs.

This structure contains attributes related to the event; by now it only contains
the server_time_utc member which is non-zero if server-time is enabled and the
server used this extension to pass a timestamp.

See issue #661.

(Note: this hooks are still not called by hexchat in this commit.)
Diffstat (limited to 'src/common/hexchat-plugin.h')
-rw-r--r--src/common/hexchat-plugin.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/common/hexchat-plugin.h b/src/common/hexchat-plugin.h
index 36dc544f..fd730459 100644
--- a/src/common/hexchat-plugin.h
+++ b/src/common/hexchat-plugin.h
@@ -46,6 +46,7 @@ extern "C" {
 typedef struct _hexchat_plugin hexchat_plugin;
 typedef struct _hexchat_list hexchat_list;
 typedef struct _hexchat_hook hexchat_hook;
+typedef struct _hexchat_event_attrs hexchat_event_attrs;
 #ifndef PLUGIN_C
 typedef struct _hexchat_context hexchat_context;
 #endif
@@ -164,6 +165,18 @@ struct _hexchat_plugin
 		const char *var);
 	int (*hexchat_pluginpref_list) (hexchat_plugin *ph,
 		char *dest);
+	hexchat_hook *(*hexchat_hook_server_attrs) (hexchat_plugin *ph,
+		   const char *name,
+		   int pri,
+		   int (*callback) (char *word[], char *word_eol[],
+							hexchat_event_attrs *attrs, void *user_data),
+		   void *userdata);
+	hexchat_hook *(*hexchat_hook_print_attrs) (hexchat_plugin *ph,
+		  const char *name,
+		  int pri,
+		  int (*callback) (char *word[], hexchat_event_attrs *attrs,
+						   void *user_data),
+		  void *userdata);
 };
 #endif
 
@@ -183,6 +196,15 @@ hexchat_hook_server (hexchat_plugin *ph,
 		   int (*callback) (char *word[], char *word_eol[], void *user_data),
 		   void *userdata);
 
+
+hexchat_hook *
+hexchat_hook_server_attrs (hexchat_plugin *ph,
+		   const char *name,
+		   int pri,
+		   int (*callback) (char *word[], char *word_eol[],
+							hexchat_event_attrs *attrs, void *user_data),
+		   void *userdata);
+
 hexchat_hook *
 hexchat_hook_print (hexchat_plugin *ph,
 		  const char *name,
@@ -191,6 +213,14 @@ hexchat_hook_print (hexchat_plugin *ph,
 		  void *userdata);
 
 hexchat_hook *
+hexchat_hook_print_attrs (hexchat_plugin *ph,
+		  const char *name,
+		  int pri,
+		  int (*callback) (char *word[], hexchat_event_attrs *attrs,
+						   void *user_data),
+		  void *userdata);
+
+hexchat_hook *
 hexchat_hook_timer (hexchat_plugin *ph,
 		  int timeout,
 		  int (*callback) (void *user_data),