Index: protocols/bee.h
===================================================================
--- protocols/bee.h	(revision 0db66186f49438ae9c2f73ca85b915e999896309)
+++ protocols/bee.h	(revision 345577bc90da1d1fffa0df013426eab54fa2b1b2)
@@ -105,5 +105,5 @@
 	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);
@@ -118,5 +118,5 @@
 	/* 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);
Index: protocols/bee_chat.c
===================================================================
--- protocols/bee_chat.c	(revision 0db66186f49438ae9c2f73ca85b915e999896309)
+++ protocols/bee_chat.c	(revision 345577bc90da1d1fffa0df013426eab54fa2b1b2)
@@ -95,14 +95,13 @@
 }
 
-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;
 	}
@@ -122,5 +121,5 @@
 
 	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);
 	}
 
Index: protocols/bee_user.c
===================================================================
--- protocols/bee_user.c	(revision 0db66186f49438ae9c2f73ca85b915e999896309)
+++ protocols/bee_user.c	(revision 345577bc90da1d1fffa0df013426eab54fa2b1b2)
@@ -247,5 +247,5 @@
 }
 
-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;
@@ -265,5 +265,5 @@
 
 	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);
@@ -297,5 +297,5 @@
 }
 
-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;
Index: protocols/nogaim.h
===================================================================
--- protocols/nogaim.h	(revision 0db66186f49438ae9c2f73ca85b915e999896309)
+++ protocols/nogaim.h	(revision 345577bc90da1d1fffa0df013426eab54fa2b1b2)
@@ -70,4 +70,5 @@
 #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 */
@@ -325,5 +326,5 @@
 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);
