diff options
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/bee.h | 4 | ||||
| -rw-r--r-- | protocols/bee_chat.c | 9 | ||||
| -rw-r--r-- | protocols/bee_user.c | 6 | ||||
| -rw-r--r-- | protocols/nogaim.h | 3 | 
4 files changed, 11 insertions, 11 deletions
| diff --git a/protocols/bee.h b/protocols/bee.h index fc27d424..a9678a6e 100644 --- a/protocols/bee.h +++ b/protocols/bee.h @@ -104,7 +104,7 @@ typedef struct bee_ui_funcs {  	/* State info is already updated, old is provided in case the UI needs a diff. */  	gboolean (*user_status)(bee_t *bee, struct bee_user *bu, struct bee_user *old);  	/* On every incoming message. sent_at = 0 means unknown. */ -	gboolean (*user_msg)(bee_t *bee, bee_user_t *bu, const char *msg, time_t sent_at); +	gboolean (*user_msg)(bee_t *bee, bee_user_t *bu, const char *msg, guint32 flags, time_t sent_at);  	/* Flags currently defined (OPT_TYPING/THINKING) in nogaim.h. */  	gboolean (*user_typing)(bee_t *bee, bee_user_t *bu, guint32 flags);  	/* CTCP-like stuff (buddy action) response */ @@ -117,7 +117,7 @@ typedef struct bee_ui_funcs {  	gboolean (*chat_free)(bee_t *bee, struct groupchat *c);  	/* System messages of any kind. */  	gboolean (*chat_log)(bee_t *bee, struct groupchat *c, const char *text); -	gboolean (*chat_msg)(bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *msg, time_t sent_at); +	gboolean (*chat_msg)(bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *msg, guint32 flags, 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, const char *reason);  	gboolean (*chat_topic)(bee_t *bee, struct groupchat *c, const char *new_topic, bee_user_t *bu); diff --git a/protocols/bee_chat.c b/protocols/bee_chat.c index 6ea86c3a..2fcb0396 100644 --- a/protocols/bee_chat.c +++ b/protocols/bee_chat.c @@ -94,16 +94,15 @@ static gboolean handle_is_self(struct im_connection *ic, const char *handle)  	       (ic->acc->prpl->handle_cmp(ic->acc->user, handle) == 0);  } -void imcb_chat_msg(struct groupchat *c, const char *who, char *msg, uint32_t flags, time_t sent_at) +void imcb_chat_msg(struct groupchat *c, const char *who, char *msg, guint32 flags, time_t sent_at)  {  	struct im_connection *ic = c->ic;  	bee_t *bee = ic->bee;  	bee_user_t *bu; -	gboolean temp; +	gboolean temp = FALSE;  	char *s; -	/* Gaim sends own messages through this too. IRC doesn't want this, so kill them */ -	if (handle_is_self(ic, who)) { +	if (handle_is_self(ic, who) && !(flags & OPT_SELFMESSAGE)) {  		return;  	} @@ -121,7 +120,7 @@ void imcb_chat_msg(struct groupchat *c, const char *who, char *msg, uint32_t fla  	}  	if (bee->ui->chat_msg) { -		bee->ui->chat_msg(bee, c, bu, msg, sent_at); +		bee->ui->chat_msg(bee, c, bu, msg, flags, sent_at);  	}  	if (temp) { diff --git a/protocols/bee_user.c b/protocols/bee_user.c index 2d63bfb4..ced92ee9 100644 --- a/protocols/bee_user.c +++ b/protocols/bee_user.c @@ -246,7 +246,7 @@ void imcb_buddy_times(struct im_connection *ic, const char *handle, time_t login  	bu->idle_time = idle;  } -void imcb_buddy_msg(struct im_connection *ic, const char *handle, const char *msg, uint32_t flags, time_t sent_at) +void imcb_buddy_msg(struct im_connection *ic, const char *handle, const char *msg, guint32 flags, time_t sent_at)  {  	bee_t *bee = ic->bee;  	bee_user_t *bu; @@ -264,7 +264,7 @@ void imcb_buddy_msg(struct im_connection *ic, const char *handle, const char *ms  	}  	if (bee->ui->user_msg && bu) { -		bee->ui->user_msg(bee, bu, msg, sent_at); +		bee->ui->user_msg(bee, bu, msg, flags, sent_at);  	} else {  		imcb_log(ic, "Message from unknown handle %s:\n%s", handle, msg);  	} @@ -296,7 +296,7 @@ void imcb_notify_email(struct im_connection *ic, char *format, ...)  	g_free(msg);  } -void imcb_buddy_typing(struct im_connection *ic, const char *handle, uint32_t flags) +void imcb_buddy_typing(struct im_connection *ic, const char *handle, guint32 flags)  {  	bee_user_t *bu; diff --git a/protocols/nogaim.h b/protocols/nogaim.h index 6e7343ba..548b22f9 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -69,6 +69,7 @@  #define OPT_NOOTR       0x00001000 /* protocol not suitable for OTR */  #define OPT_PONGS       0x00010000 /* Service sends us keep-alives */  #define OPT_PONGED      0x00020000 /* Received a keep-alive during last interval */ +#define OPT_SELFMESSAGE 0x00080000 /* A message sent by self from another location */  /* ok. now the fun begins. first we create a connection structure */  struct im_connection { @@ -324,7 +325,7 @@ G_MODULE_EXPORT void imcb_rename_buddy(struct im_connection *ic, const char *han  G_MODULE_EXPORT void imcb_buddy_nick_hint(struct im_connection *ic, const char *handle, const char *nick);  G_MODULE_EXPORT void imcb_buddy_action_response(bee_user_t *bu, const char *action, char * const args[], void *data); -G_MODULE_EXPORT void imcb_buddy_typing(struct im_connection *ic, const char *handle, uint32_t flags); +G_MODULE_EXPORT void imcb_buddy_typing(struct im_connection *ic, const char *handle, guint32 flags);  G_MODULE_EXPORT struct bee_user *imcb_buddy_by_handle(struct im_connection *ic, const char *handle);  G_MODULE_EXPORT void imcb_clean_handle(struct im_connection *ic, char *handle); | 
