First step towards message tags extension support

(see http://ircv3.atheme.org/specification/message-tags-3.2).

In particular this commit implements a (very) dummy implementation
sketch of the server-time extension
(see http://ircv3.atheme.org/specification/message-tags-3.2 and #499).
This commit is contained in:
Diogo Sousa
2013-06-22 00:13:36 +01:00
parent ac5771377e
commit 94186f7888
7 changed files with 136 additions and 32 deletions

View File

@@ -17,12 +17,17 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <time.h>
#include "textenums.h"
#ifndef HEXCHAT_TEXT_H
#define HEXCHAT_TEXT_H
#define EMIT_SIGNAL(i, sess, a, b, c, d, e) text_emit(i, sess, a, b, c, d)
/* timestamp is non-zero if we are using server-time */
#define EMIT_SIGNAL_TIMESTAMP(i, sess, a, b, c, d, e, timestamp) \
text_emit(i, sess, a, b, c, d, timestamp)
#define EMIT_SIGNAL(i, sess, a, b, c, d, e) \
text_emit(i, sess, a, b, c, d, 0)
struct text_event
{
@@ -46,7 +51,8 @@ int pevt_build_string (const char *input, char **output, int *max_arg);
int pevent_load (char *filename);
void pevent_make_pntevts (void);
int text_color_of (char *name);
void text_emit (int index, session *sess, char *a, char *b, char *c, char *d);
void text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
time_t timestamp);
int text_emit_by_name (char *name, session *sess, char *a, char *b, char *c, char *d);
char *text_validate (char **text, int *len);
int get_stamp_str (char *fmt, time_t tim, char **ret);