Changeset e900442


Ignore:
Timestamp:
2007-07-05T23:39:47Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
c9c7ca7
Parents:
9da0bbf (diff), 19a8088 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging from devel. Added documentation for the join_chat command, adding
a debian/ tree and a merge from Jelmer (mainly unittest stuff).

Files:
28 added
18 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r9da0bbf re900442  
    5050        $(MAKE) -C tests
    5151
     52lcov:
    5253gcov: check
    5354        gcov *.c
     55
     56lcov: check
     57        lcov --directory . --capture --output-file bitlbee.info
     58        genhtml -o coverage bitlbee.info
    5459
    5560install-doc:
  • doc/user-guide/commands.xml

    r9da0bbf re900442  
    811811        </bitlbee-command>
    812812
    813         <bitlbee-command name="import_buddies">
    814                 <short-description>Copy local buddy list to server (normally only needed when upgrading)</short-description>
    815                 <syntax>import_buddies &lt;connection&gt; [clear]</syntax>
    816 
    817                 <description>
    818                         <para>
    819                                 This command copies the locally stored buddy list to the server. This command exists for upgrading purposes. Previous versions of BitlBee didn't support server-side buddy lists for ICQ, so the list was stored locally.
    820                         </para>
    821 
    822                         <para>
    823                                 Since version 0.91 however, server-side contact lists are supported for all protocols, so the local list is now ignored. When upgrading from an older BitlBee to version 0.91, you might need this command to get your buddy list back.
    824                         </para>
    825 
    826                         <para>
    827                                 The only argument this command needs is your ICQ account identification. If your serverside buddy list contains some old buddies you don't want anymore, you can pass <emphasis>clear</emphasis> as a second argument.
    828                         </para>
    829 
    830                         <para>
    831                                 After giving this command, you have to wait for a while before all the adds are handled, because of ICQ's rate limiting. If your buddy list is very large and the ICQ server starts complaining, you might have to reconnect and enter this command again.
    832                         </para>
    833                 </description>
     813        <bitlbee-command name="join_chat">
     814                <short-description>Join a named groupchat/conference room</short-description>
     815                <syntax>import_buddies &lt;connection&gt; &lt;room name&gt; [&lt;channel name&gt;] [&lt;room nickname&gt;] [&lt;password&gt;]</syntax>
     816
     817                <description>
     818                        <para>
     819                                On most IM-networks groupchats can be started using the /join command. (<emphasis>/join #foo</emphasis> to start a chatroom with you and <emphasis>foo</emphasis>) This doesn't work with names groupchats though (which exist on Jabber networks and AIM, for example), instead you can use this command.
     820                        </para>
     821
     822                        <para>
     823                                The first two arguments are required. <emphasis>room name</emphasis> is the name of the chatroom on the IM-network. <emphasis>channel name</emphasis> is the IRC channel name BitlBee should map this to. <emphasis>room nickname</emphasis> is the nickname you want to have in this channel. If you don't give these options, BitlBee will do the right guesses.
     824                        </para>
     825
     826                        <para>
     827                                The following command will join you to the chatroom called <emphasis>bitlbee@conference.bitlbee.org</emphasis>. The channel will be called <emphasis>&amp;bitlbee-help</emphasis> because <emphasis>&amp;bitlbee</emphasis> will already be in use. Your nickname will be <emphasis>help-me</emphasis>.
     828                        </para>
     829                </description>
     830
     831                <ircexample>
     832                        <ircline nick="wilmer">join_chat jabber bitlbee@conference.bitlbee.org &amp;bitlbee-help help-me</ircline>
     833                </ircexample>
    834834
    835835        </bitlbee-command>
  • help.c

    r9da0bbf re900442  
    3131#define BUFSIZE 1100
    3232
    33 help_t *help_init( help_t **help )
     33help_t *help_init( help_t **help, const char *helpfile )
    3434{
    3535        int i, buflen = 0;
     
    4141        *help = h = g_new0 ( help_t, 1 );
    4242       
    43         h->fd = open( global.helpfile, O_RDONLY
     43        h->fd = open( helpfile, O_RDONLY
    4444#ifdef _WIN32
    4545                                  | O_BINARY
     
    109109        help_t *h;
    110110
    111         h=*help;       
    112 
    113         while( h )
     111        for( h = *help; h; h = h->next )
    114112        {
    115                 if( g_strcasecmp( h->string, string ) == 0 ) break;
    116                 h = h->next;
     113                if( h->string != NULL &&
     114                        g_strcasecmp( h->string, string ) == 0 )
     115                        break;
    117116        }
    118117        if( h && h->length > 0 )
  • help.h

    r9da0bbf re900442  
    4343} help_t;
    4444
    45 help_t *help_init( help_t **help );
     45help_t *help_init( help_t **help, const char *helpfile );
    4646char *help_get( help_t **help, char *string );
    4747
  • lib/Makefile

    r9da0bbf re900442  
    1818all: lib.o
    1919check: all
     20lcov:
    2021gcov:
    2122        gcov *.c
  • protocols/Makefile

    r9da0bbf re900442  
    2727all: protocols.o
    2828check: all
     29lcov:
    2930gcov:
    3031        gcov *.c
  • protocols/jabber/Makefile

    r9da0bbf re900442  
    1818all: jabber_mod.o
    1919check: all
     20lcov:
    2021gcov:
    2122        gcov *.c
  • protocols/msn/Makefile

    r9da0bbf re900442  
    1818all: msn_mod.o
    1919check: all
     20lcov:
    2021gcov:
    2122        gcov *.c
  • protocols/oscar/Makefile

    r9da0bbf re900442  
    1818all: oscar_mod.o
    1919check: all
     20lcov:
    2021gcov:
    2122        gcov *.c
  • protocols/oscar/oscar.c

    r9da0bbf re900442  
    22562256        }
    22572257        info_string_append(str, "\n", _("Mobile Phone"), info->mobile);
    2258         info_string_append(str, "\n", _("Gender"), info->gender==1 ? _("Female") : info->gender==2 ? _("Male") : _("Unknown"));
     2258        if (info->gender != 0)
     2259                info_string_append(str, "\n", _("Gender"), info->gender==1 ? _("Female") : _("Male"));
    22592260        if (info->birthyear || info->birthmonth || info->birthday) {
    22602261                char date[30];
  • protocols/yahoo/Makefile

    r9da0bbf re900442  
    1818all: yahoo_mod.o
    1919check: all
     20lcov:
    2021gcov:
    2122        gcov *.c
  • set.h

    r9da0bbf re900442  
    2323  Suite 330, Boston, MA  02111-1307  USA
    2424*/
     25
     26#ifndef __SET_H__
     27#define __SET_H__
     28
     29struct set;
    2530
    2631/* This used to be specific to irc_t structures, but it's more generic now
     
    9297char *set_eval_ops( set_t *set, char *value );
    9398char *set_eval_charset( set_t *set, char *value );
     99
     100#endif /* __SET_H__ */
  • tests/Makefile

    r9da0bbf re900442  
    1313main_objs = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_xml.o storage_text.o user.o
    1414
    15 test_objs = check.o check_util.o check_nick.o check_md5.o check_irc.o
     15test_objs = check.o check_util.o check_nick.o check_md5.o check_irc.o check_help.o check_user.o check_crypting.o check_set.o
    1616
    1717check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o ../lib/lib.o
  • tests/check.c

    r9da0bbf re900442  
    2121}
    2222
     23irc_t *torture_irc(void)
     24{
     25        irc_t *irc;
     26        GIOChannel *ch1, *ch2;
     27        if (!g_io_channel_pair(&ch1, &ch2))
     28                return NULL;
     29        irc = irc_new(g_io_channel_unix_get_fd(ch1));
     30        return irc;
     31}
     32
    2333double gettime()
    2434{
     
    4050/* From check_irc.c */
    4151Suite *irc_suite(void);
     52
     53/* From check_help.c */
     54Suite *help_suite(void);
     55
     56/* From check_user.c */
     57Suite *user_suite(void);
     58
     59/* From check_crypting.c */
     60Suite *crypting_suite(void);
     61
     62/* From check_set.c */
     63Suite *set_suite(void);
    4264
    4365int main (int argc, char **argv)
     
    6789        if (verbose) {
    6890                log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE );
     91#ifdef DEBUG
    6992                log_link( LOGLVL_DEBUG, LOGOUTPUT_CONSOLE );
     93#endif
    7094                log_link( LOGLVL_INFO, LOGOUTPUT_CONSOLE );
    7195                log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE );
     
    79103        srunner_add_suite(sr, md5_suite());
    80104        srunner_add_suite(sr, irc_suite());
     105        srunner_add_suite(sr, help_suite());
     106        srunner_add_suite(sr, user_suite());
     107        srunner_add_suite(sr, crypting_suite());
     108        srunner_add_suite(sr, set_suite());
    81109        if (no_fork)
    82110                srunner_set_fork_status(sr, CK_NOFORK);
  • tests/check_util.c

    r9da0bbf re900442  
    77#include "set.h"
    88#include "misc.h"
     9#include "url.h"
    910
    1011START_TEST(test_strip_linefeed)
     
    4344END_TEST
    4445
     46START_TEST(test_set_url_http)
     47        url_t url;
     48       
     49        fail_if (0 == url_set(&url, "http://host/"));
     50        fail_unless (!strcmp(url.host, "host"));
     51        fail_unless (!strcmp(url.file, "/"));
     52        fail_unless (!strcmp(url.user, ""));
     53        fail_unless (!strcmp(url.pass, ""));
     54        fail_unless (url.proto == PROTO_HTTP);
     55        fail_unless (url.port == 80);
     56END_TEST
     57
     58START_TEST(test_set_url_https)
     59        url_t url;
     60       
     61        fail_if (0 == url_set(&url, "https://ahost/AimeeMann"));
     62        fail_unless (!strcmp(url.host, "ahost"));
     63        fail_unless (!strcmp(url.file, "/AimeeMann"));
     64        fail_unless (!strcmp(url.user, ""));
     65        fail_unless (!strcmp(url.pass, ""));
     66        fail_unless (url.proto == PROTO_HTTPS);
     67        fail_unless (url.port == 443);
     68END_TEST
     69
     70START_TEST(test_set_url_port)
     71        url_t url;
     72       
     73        fail_if (0 == url_set(&url, "https://ahost:200/Lost/In/Space"));
     74        fail_unless (!strcmp(url.host, "ahost"));
     75        fail_unless (!strcmp(url.file, "/Lost/In/Space"));
     76        fail_unless (!strcmp(url.user, ""));
     77        fail_unless (!strcmp(url.pass, ""));
     78        fail_unless (url.proto == PROTO_HTTPS);
     79        fail_unless (url.port == 200);
     80END_TEST
     81
     82START_TEST(test_set_url_username)
     83        url_t url;
     84       
     85        fail_if (0 == url_set(&url, "socks4://user@ahost/Space"));
     86        fail_unless (!strcmp(url.host, "ahost"));
     87        fail_unless (!strcmp(url.file, "/Space"));
     88        fail_unless (!strcmp(url.user, "user"));
     89        fail_unless (!strcmp(url.pass, ""));
     90        fail_unless (url.proto == PROTO_SOCKS4);
     91        fail_unless (url.port == 1080);
     92END_TEST
     93
     94START_TEST(test_set_url_username_pwd)
     95        url_t url;
     96       
     97        fail_if (0 == url_set(&url, "socks5://user:pass@ahost/"));
     98        fail_unless (!strcmp(url.host, "ahost"));
     99        fail_unless (!strcmp(url.file, "/"));
     100        fail_unless (!strcmp(url.user, "user"));
     101        fail_unless (!strcmp(url.pass, "pass"));
     102        fail_unless (url.proto == PROTO_SOCKS5);
     103        fail_unless (url.port == 1080);
     104END_TEST
     105
    45106Suite *util_suite (void)
    46107{
     
    50111        tcase_add_test (tc_core, test_strip_linefeed);
    51112        tcase_add_test (tc_core, test_strip_newlines);
     113        tcase_add_test (tc_core, test_set_url_http);
     114        tcase_add_test (tc_core, test_set_url_https);
     115        tcase_add_test (tc_core, test_set_url_port);
     116        tcase_add_test (tc_core, test_set_url_username);
     117        tcase_add_test (tc_core, test_set_url_username_pwd);
    52118        return s;
    53119}
  • tests/testsuite.h

    r9da0bbf re900442  
    22#define __BITLBEE_CHECK_H__
    33
     4#include "irc.h"
     5
     6irc_t *torture_irc(void);
    47gboolean g_io_channel_pair(GIOChannel **ch1, GIOChannel **ch2);
    58
  • unix.c

    r9da0bbf re900442  
    112112        if( !getuid() || !geteuid() )
    113113                log_message( LOGLVL_WARNING, "BitlBee is running with root privileges. Why?" );
    114         if( help_init( &(global.help) ) == NULL )
     114        if( help_init( &(global.help), global.helpfile ) == NULL )
    115115                log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE );
    116116       
  • user.h

    r9da0bbf re900442  
    2323  Suite 330, Boston, MA  02111-1307  USA
    2424*/
     25#ifndef __USER_H__
     26#define __USER_H__
    2527
    2628typedef struct __USER
     
    5658G_MODULE_EXPORT user_t *user_findhandle( struct im_connection *ic, char *handle );
    5759void user_rename( irc_t *irc, char *oldnick, char *newnick );
     60
     61#endif /* __USER_H__ */
Note: See TracChangeset for help on using the changeset viewer.