Changeset 345577b for protocols/bee.h


Ignore:
Timestamp:
2015-10-30T10:27:20Z (8 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
fb2338d
Parents:
0db6618
git-author:
dequis <dx@…> (13-09-15 04:17:14)
git-committer:
dequis <dx@…> (30-10-15 10:27:20)
Message:

IRC self-message support (messages sent by yourself from other clients)

This adds an OPT_SELFMESSAGE flag that can be passed to imcb_buddy_msg()
or imcb_chat_msg() to indicate that the protocol knows that the message
being sent is a self message.

This needs to be explicit since the old behavior is to silently drop
these messages, which also removed server echoes.

This commit doesn't break API/ABI, the flags parameters that were added
are all internal (between protocols and UI code)

On the irc protocol side, the situation isn't very nice, since some
clients put these messages in the wrong window. Irssi, hexchat and mirc
get this wrong. Irssi 0.8.18 has a fix for it, and the others have
scripts to patch it.

But meanwhile, there's a "self_messages" global setting that lets users
disable this, or get them as normal messages / notices with a "->"
prefix, which loosely imitates the workaround used by the ZNC
"privmsg_prefix" module.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/bee.h

    r0db6618 r345577b  
    105105        gboolean (*user_status)(bee_t *bee, struct bee_user *bu, struct bee_user *old);
    106106        /* On every incoming message. sent_at = 0 means unknown. */
    107         gboolean (*user_msg)(bee_t *bee, bee_user_t *bu, const char *msg, time_t sent_at);
     107        gboolean (*user_msg)(bee_t *bee, bee_user_t *bu, const char *msg, guint32 flags, time_t sent_at);
    108108        /* Flags currently defined (OPT_TYPING/THINKING) in nogaim.h. */
    109109        gboolean (*user_typing)(bee_t *bee, bee_user_t *bu, guint32 flags);
     
    118118        /* System messages of any kind. */
    119119        gboolean (*chat_log)(bee_t *bee, struct groupchat *c, const char *text);
    120         gboolean (*chat_msg)(bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *msg, time_t sent_at);
     120        gboolean (*chat_msg)(bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *msg, guint32 flags, time_t sent_at);
    121121        gboolean (*chat_add_user)(bee_t *bee, struct groupchat *c, bee_user_t *bu);
    122122        gboolean (*chat_remove_user)(bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *reason);
Note: See TracChangeset for help on using the changeset viewer.