1 IRC wouldn't be of much interest without the ability for users to join
2 channels. Of course, they must also be able to leave those channels
3 when they get bored of the conversation there. Users can join or
4 leave multiple channels at once. Sometimes these JOIN and PART
5 messages can be ganged together into a single message. This is
6 facilitated by the JoinBuf system.
11 This structure is used to accumulate and describe several channel
12 joins or parts. None of its fields are directly or indirectly
13 accessible to the application; a struct JoinBuf is only suitable for
14 passing to the joinbuf_*() suite of functions. JoinBuf structures
15 must be allocated by the caller.
19 #define JOINBUF_TYPE_JOIN 0 /* send JOINs */
21 This macro tells joinbuf_init() that the JoinBuf is being used to
22 generate several channel joins.
26 #define JOINBUF_TYPE_CREATE 1 /* send CREATEs */
28 This macro tells joinbuf_init() that the JoinBuf is being used to
29 generate several channel creations.
33 #define JOINBUF_TYPE_PART 2 /* send PARTs */
35 This macro tells joinbuf_init() that the JoinBuf is being used to
36 generate several channel parts.
40 #define JOINBUF_TYPE_PARTALL 3 /* send local PARTs, but not remote */
42 This macro tells joinbuf_init() that the JoinBuf is being used to
43 record PARTs for all the user's channels. That fact is communicated
44 to servers through a more efficient means than sending several PARTs,
45 but local clients can only be made aware of it with standard PART
50 void joinbuf_init(struct JoinBuf *jbuf, struct Client *source,
51 struct Client *connect, unsigned int type, char *comment,
54 This function is used to initialize a caller allocated JoinBuf,
55 specified by _jbuf_. The originating user is specified by _source_;
56 the connection on which the message was received is specified by
57 _connect_; the type (one of the JOINBUF_TYPE_* macros described above)
58 is specified by _type_. PART messages may have an optional comment,
59 which is passed through the _comment_ parameter. JOIN and CREATE
60 messages require a timestamp, passed through the _create_ parameter.
64 void joinbuf_join(struct JoinBuf *jbuf, struct Channel *chan,
67 This function adds a channel to the JoinBuf. The _chan_ parameter
68 specifies the channel, and may only be NULL if the JoinBuf type is
69 JOINBUF_TYPE_JOIN--this will cause a "JOIN 0" message to be sent to
70 all servers. The _flags_ parameter is used to specify the user's
71 current channel flags. For JOINBUF_TYPE_PART and JOINBUF_TYPE_PARTALL
72 JoinBufs, passing CHFL_ZOMBIE will inhibit sending the PART to all
73 channel users, and CHFL_BANNED will inhibit sending the user's
74 specified PART comment. For JOINBUF_TYPE_JOIN or JOINBUF_TYPE_CREATE
75 JoinBufs, the _flags_ parameter is used to set the initial channel
80 int joinbuf_flush(struct JoinBuf *jbuf);
82 This function simply flushes the contents of the struct JoinBuf to the
83 appropriate destinations.
91 [2001-6-15 Kev] Initial documentation of the JoinBuf subsystem.