diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-05-06 01:28:56 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-05-06 01:28:56 +0100 |
commit | aea8b68bd0e057441d671c008200e71dd046a211 (patch) | |
tree | ba3d668eec9747c9009a50e8cdbaa842bddf446c /protocols/bee.h | |
parent | 94383231eddf56112cf74f2ae65d691821d70803 (diff) |
Starting to restore chatroom stuff. Only enough to create and be joined
into a room. More will follow soon.
Diffstat (limited to 'protocols/bee.h')
-rw-r--r-- | protocols/bee.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/protocols/bee.h b/protocols/bee.h index 62f60477..f69d29d4 100644 --- a/protocols/bee.h +++ b/protocols/bee.h @@ -27,6 +27,7 @@ #define __BEE_H__ struct bee_ui_funcs; +struct groupchat; typedef struct bee { @@ -35,6 +36,11 @@ typedef struct bee GSList *users; struct account *accounts; /* TODO(wilmer): Use GSList here too? */ + /* Symbolic, to refer to the local user (who has no real bee_user + object). Not to be used by anything except so far imcb_chat_add/ + remove_buddy(). This seems slightly cleaner than abusing NULL. */ + struct bee_user *user; + const struct bee_ui_funcs *ui; void *ui_data; } bee_t; @@ -72,6 +78,13 @@ typedef struct bee_ui_funcs gboolean (*user_msg)( bee_t *bee, bee_user_t *bu, const char *msg, time_t sent_at ); gboolean (*user_typing)( bee_t *bee, bee_user_t *bu, guint32 flags ); + gboolean (*chat_new)( bee_t *bee, struct groupchat *c ); + gboolean (*chat_free)( bee_t *bee, struct groupchat *c ); + gboolean (*chat_log)( bee_t *bee, struct groupchat *c, const char *format, ... ); + gboolean (*chat_msg)( bee_t *bee, struct groupchat *c, const char *who, const char *msg, time_t sent_at ); + gboolean (*chat_add_user)( bee_t *bee, struct groupchat *c, bee_user_t *bu ); + gboolean (*chat_remove_user)( bee_t *bee, struct groupchat *c, bee_user_t *bu ); + struct file_transfer* (*ft_in_start)( bee_t *bee, bee_user_t *bu, const char *file_name, size_t file_size ); gboolean (*ft_out_start)( struct im_connection *ic, struct file_transfer *ft ); void (*ft_close)( struct im_connection *ic, struct file_transfer *ft ); @@ -100,4 +113,17 @@ G_MODULE_EXPORT void imcb_buddy_status( struct im_connection *ic, const char *ha /* Call when a handle says something. 'flags' and 'sent_at may be just 0. */ G_MODULE_EXPORT void imcb_buddy_msg( struct im_connection *ic, const char *handle, char *msg, guint32 flags, time_t sent_at ); +/* bee_chat.c */ +#if 0 +struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle ); +void imcb_chat_name_hint( struct groupchat *c, const char *name ); +void imcb_chat_free( struct groupchat *c ); +void imcb_chat_msg( struct groupchat *c, const char *who, char *msg, uint32_t flags, time_t sent_at ); +void imcb_chat_log( struct groupchat *c, char *format, ... ); +void imcb_chat_topic( struct groupchat *c, char *who, char *topic, time_t set_at ); +void imcb_chat_add_buddy( struct groupchat *b, const char *handle ); +void imcb_chat_remove_buddy( struct groupchat *b, const char *handle, const char *reason ); +static int remove_chat_buddy_silent( struct groupchat *b, const char *handle ); +#endif + #endif /* __BEE_H__ */ |