Mercurial > hg
comparison mcabber/src/commands.c @ 831:dd865cc57aa2
Fix joining a room when the buddylist is empty
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 04 May 2006 10:35:45 +0200 |
parents | 80bd7f49075f |
children | 6a732d2ad4b4 |
comparison
equal
deleted
inserted
replaced
830:80434fde7cfa | 831:dd865cc57aa2 |
---|---|
1860 if (!jb_getonline()) { | 1860 if (!jb_getonline()) { |
1861 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); | 1861 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); |
1862 return; | 1862 return; |
1863 } | 1863 } |
1864 | 1864 |
1865 if (!current_buddy) return; | |
1866 bud = BUDDATA(current_buddy); | |
1867 | |
1868 paramlst = split_arg(arg, 2, 1); // subcmd, arg | 1865 paramlst = split_arg(arg, 2, 1); // subcmd, arg |
1869 subcmd = *paramlst; | 1866 subcmd = *paramlst; |
1870 arg = *(paramlst+1); | 1867 arg = *(paramlst+1); |
1871 | 1868 |
1872 if (!subcmd || !*subcmd) { | 1869 if (!subcmd || !*subcmd) { |
1873 scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); | 1870 scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); |
1874 free_arg_lst(paramlst); | 1871 free_arg_lst(paramlst); |
1875 return; | 1872 return; |
1873 } | |
1874 | |
1875 if (current_buddy) { | |
1876 bud = BUDDATA(current_buddy); | |
1877 } else { | |
1878 if (strcasecmp(subcmd, "join")) | |
1879 return; | |
1880 // "room join" is a special case, we don't need to have a valid | |
1881 // current_buddy. | |
1882 bud = NULL; | |
1876 } | 1883 } |
1877 | 1884 |
1878 if (!strcasecmp(subcmd, "join")) { | 1885 if (!strcasecmp(subcmd, "join")) { |
1879 if ((arg = check_room_subcommand(arg, TRUE, NULL)) != NULL) | 1886 if ((arg = check_room_subcommand(arg, TRUE, NULL)) != NULL) |
1880 room_join(bud, arg); | 1887 room_join(bud, arg); |