# HG changeset patch # User Rob Flynn # Date 1035329509 0 # Node ID fb519383a058d0ccadccae3922fab700b5bd941b # Parent 56e555b72873be712e25d0e4a9b6258c5bfa320f [gaim-migrate @ 3929] IRC passwd patch from Chip. Fixed a compile warning in conversation.c. Nathan, tell me if this breaks anything ;-) committer: Tailor Script diff -r 56e555b72873 -r fb519383a058 ChangeLog --- a/ChangeLog Tue Oct 22 23:18:45 2002 +0000 +++ b/ChangeLog Tue Oct 22 23:31:49 2002 +0000 @@ -97,6 +97,7 @@ * Switch the .desktop file to the new KDE/GNOME common vfolder format (Thanks Robert McQueen). * Allow only people in buddy list privacy option added for AIM + * Optional password on IRC accounts (Thanks, Christian Hammond) version 0.59 (06/24/2002): * Hungarian translation added (Thanks, Sutto Zoltan) diff -r 56e555b72873 -r fb519383a058 src/conversation.c --- a/src/conversation.c Tue Oct 22 23:18:45 2002 +0000 +++ b/src/conversation.c Tue Oct 22 23:31:49 2002 +0000 @@ -2680,7 +2680,7 @@ style->fg[0].green = 0x9999; style->fg[0].blue = 0x0000; } else if(c->typing_state == TYPED) { - style->fg[0].red = 0xfffff; + style->fg[0].red = 0xffff; style->fg[0].green = 0xbbbb; style->fg[0].blue = 0x2222; } else if(c->unseen == 2) { diff -r 56e555b72873 -r fb519383a058 src/multi.c --- a/src/multi.c Tue Oct 22 23:18:45 2002 +0000 +++ b/src/multi.c Tue Oct 22 23:31:49 2002 +0000 @@ -1066,7 +1066,8 @@ p = find_prpl(u->protocol); if (!u->gc && p && p->login) { struct prpl *p = find_prpl(u->protocol); - if (p && !(p->options & OPT_PROTO_NO_PASSWORD) && !u->password[0]) { + if (p && !(p->options & OPT_PROTO_NO_PASSWORD) && + !(p->options & OPT_PROTO_PASSWORD_OPTIONAL) && !u->password[0]) { do_pass_dlg(u); } else { serv_login(u); diff -r 56e555b72873 -r fb519383a058 src/protocols/irc/irc.c --- a/src/protocols/irc/irc.c Tue Oct 22 23:18:45 2002 +0000 +++ b/src/protocols/irc/irc.c Tue Oct 22 23:31:49 2002 +0000 @@ -1669,6 +1669,17 @@ hostname[sizeof(hostname) - 1] = 0; if (!*hostname) g_snprintf(hostname, sizeof(hostname), "localhost"); + + if (*gc->user->password) { + g_snprintf(buf, sizeof(buf), "PASS %s\r\n", gc->user->password); + + if (irc_write(idata->fd, buf, strlen(buf)) < 0) { + hide_login_progress(gc, "Write error"); + signoff(gc); + return; + } + } + g_snprintf(buf, sizeof(buf), "USER %s %s %s :%s\r\n", g_get_user_name(), hostname, gc->user->proto_opt[USEROPT_SERV], @@ -2670,7 +2681,7 @@ { struct proto_user_opt *puo; ret->protocol = PROTO_IRC; - ret->options = OPT_PROTO_CHAT_TOPIC | OPT_PROTO_NO_PASSWORD; + ret->options = OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL; ret->name = g_strdup("IRC"); ret->list_icon = irc_list_icon; ret->login = irc_login; diff -r 56e555b72873 -r fb519383a058 src/prpl.h --- a/src/prpl.h Tue Oct 22 23:18:45 2002 +0000 +++ b/src/prpl.h Tue Oct 22 23:31:49 2002 +0000 @@ -61,20 +61,22 @@ /* #define OPT_PROTO_HTML 0x00000001 this should be per-connection */ /* TOC/Oscar have signon time, and the server's time needs to be adjusted to match * your computer's time. We wouldn't need this if everyone used NTP. */ -#define OPT_PROTO_CORRECT_TIME 0x00000002 +#define OPT_PROTO_CORRECT_TIME 0x00000002 /* Jabber lets you choose what name you want for chat. So it shouldn't be pulling * the alias for when you're in chat; it gets annoying. */ -#define OPT_PROTO_UNIQUE_CHATNAME 0x00000004 +#define OPT_PROTO_UNIQUE_CHATNAME 0x00000004 /* IRC, Jabber let you have chat room topics */ -#define OPT_PROTO_CHAT_TOPIC 0x00000008 -/* IRC and Zephyr don't require passwords, so there's no need for a password prompt */ -#define OPT_PROTO_NO_PASSWORD 0x00000010 +#define OPT_PROTO_CHAT_TOPIC 0x00000008 +/* Zephyr doesn't require passwords, so there's no need for a password prompt */ +#define OPT_PROTO_NO_PASSWORD 0x00000010 /* MSN and Yahoo notify you when you have new mail */ -#define OPT_PROTO_MAIL_CHECK 0x00000020 +#define OPT_PROTO_MAIL_CHECK 0x00000020 /* Oscar and Jabber have buddy icons */ -#define OPT_PROTO_BUDDY_ICON 0x00000040 +#define OPT_PROTO_BUDDY_ICON 0x00000040 /* Oscar lets you send images in direct IMs */ -#define OPT_PROTO_IM_IMAGE 0x00000080 +#define OPT_PROTO_IM_IMAGE 0x00000080 +/* Passwords in IRC are optional, and are needed for certain functionality. */ +#define OPT_PROTO_PASSWORD_OPTIONAL 0x00000100 #define GAIM_AWAY_CUSTOM "Custom" diff -r 56e555b72873 -r fb519383a058 src/server.c --- a/src/server.c Tue Oct 22 23:18:45 2002 +0000 +++ b/src/server.c Tue Oct 22 23:31:49 2002 +0000 @@ -60,7 +60,8 @@ #endif if (p->login) { - if (!strlen(user->password) && !(p->options & OPT_PROTO_NO_PASSWORD)) { + if (!strlen(user->password) && !(p->options & OPT_PROTO_NO_PASSWORD) && + !(p->options & OPT_PROTO_PASSWORD_OPTIONAL)) { do_error_dialog(_("Please enter your password"), NULL, GAIM_ERROR); return; }