Changeset 63075d7


Ignore:
Timestamp:
2008-02-03T23:33:18Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
69ac78c
Parents:
8ff0a61
Message:

Messages from the user are also included in backlogs when joining a Jabber
chatroom. Until now they were ignored, which might make backlogs a little
bit confusing.

Location:
protocols/jabber
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/conference.c

    r8ff0a61 r63075d7  
    122122        struct jabber_chat *jc = c->data;
    123123        struct xt_node *node;
     124       
     125        jc->flags |= JCFLAG_MESSAGE_SENT;
    124126       
    125127        node = xt_new_node( "body", message, NULL );
     
    295297        struct xt_node *subject = xt_find_node( node->children, "subject" );
    296298        struct xt_node *body = xt_find_node( node->children, "body" );
    297         struct groupchat *chat = NULL;
     299        struct groupchat *chat = bud ? jabber_chat_by_jid( ic, bud->bare_jid ) : NULL;
     300        struct jabber_chat *jc = chat ? chat->data : NULL;
    298301        char *s;
    299302       
    300         if( bud == NULL )
     303        if( bud == NULL || ( jc && ~jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me ) )
    301304        {
    302305                char *nick;
     
    346349                return;
    347350        }
    348         else if( ( chat = jabber_chat_by_jid( ic, bud->bare_jid ) ) == NULL )
     351        else if( chat == NULL )
    349352        {
    350353                /* How could this happen?? We could do kill( self, 11 )
  • protocols/jabber/jabber.h

    r8ff0a61 r63075d7  
    4949typedef enum
    5050{
    51         JBFLAG_PROBED_XEP85 = 1,        /* Set this when we sent our probe packet to make
     51        JBFLAG_PROBED_XEP85 = 1,        /* Set this when we sent our probe packet to make
    5252                                           sure it gets sent only once. */
    53         JBFLAG_DOES_XEP85 = 2,          /* Set this when the resource seems to support
     53        JBFLAG_DOES_XEP85 = 2,          /* Set this when the resource seems to support
    5454                                           XEP85 (typing notification shite). */
    55         JBFLAG_IS_CHATROOM = 4,         /* It's convenient to use this JID thingy for
     55        JBFLAG_IS_CHATROOM = 4,         /* It's convenient to use this JID thingy for
    5656                                           groupchat state info too. */
    57         JBFLAG_IS_ANONYMOUS = 8,        /* For anonymous chatrooms, when we don't have
     57        JBFLAG_IS_ANONYMOUS = 8,        /* For anonymous chatrooms, when we don't have
    5858                                           have a real JID. */
    5959} jabber_buddy_flags_t;
     60
     61typedef enum
     62{
     63        JCFLAG_MESSAGE_SENT = 1,        /* Set this after sending the first message, so
     64                                           we can detect echoes/backlogs. */
     65} jabber_chat_flags_t;
    6066
    6167struct jabber_data
Note: See TracChangeset for help on using the changeset viewer.