Mercurial > pidgin
comparison src/protocols/irc/irc.c @ 3789:fb519383a058
[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 <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Tue, 22 Oct 2002 23:31:49 +0000 |
parents | e25577506dec |
children | ed3e19143373 |
comparison
equal
deleted
inserted
replaced
3788:56e555b72873 | 3789:fb519383a058 |
---|---|
1667 | 1667 |
1668 gethostname(hostname, sizeof(hostname) - 1); | 1668 gethostname(hostname, sizeof(hostname) - 1); |
1669 hostname[sizeof(hostname) - 1] = 0; | 1669 hostname[sizeof(hostname) - 1] = 0; |
1670 if (!*hostname) | 1670 if (!*hostname) |
1671 g_snprintf(hostname, sizeof(hostname), "localhost"); | 1671 g_snprintf(hostname, sizeof(hostname), "localhost"); |
1672 | |
1673 if (*gc->user->password) { | |
1674 g_snprintf(buf, sizeof(buf), "PASS %s\r\n", gc->user->password); | |
1675 | |
1676 if (irc_write(idata->fd, buf, strlen(buf)) < 0) { | |
1677 hide_login_progress(gc, "Write error"); | |
1678 signoff(gc); | |
1679 return; | |
1680 } | |
1681 } | |
1682 | |
1672 g_snprintf(buf, sizeof(buf), "USER %s %s %s :%s\r\n", | 1683 g_snprintf(buf, sizeof(buf), "USER %s %s %s :%s\r\n", |
1673 g_get_user_name(), hostname, | 1684 g_get_user_name(), hostname, |
1674 gc->user->proto_opt[USEROPT_SERV], | 1685 gc->user->proto_opt[USEROPT_SERV], |
1675 gc->user->alias && strlen(gc->user->alias) ? gc->user->alias : "gaim"); | 1686 gc->user->alias && strlen(gc->user->alias) ? gc->user->alias : "gaim"); |
1676 if (irc_write(idata->fd, buf, strlen(buf)) < 0) { | 1687 if (irc_write(idata->fd, buf, strlen(buf)) < 0) { |
2668 G_MODULE_EXPORT void | 2679 G_MODULE_EXPORT void |
2669 irc_init(struct prpl *ret) | 2680 irc_init(struct prpl *ret) |
2670 { | 2681 { |
2671 struct proto_user_opt *puo; | 2682 struct proto_user_opt *puo; |
2672 ret->protocol = PROTO_IRC; | 2683 ret->protocol = PROTO_IRC; |
2673 ret->options = OPT_PROTO_CHAT_TOPIC | OPT_PROTO_NO_PASSWORD; | 2684 ret->options = OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL; |
2674 ret->name = g_strdup("IRC"); | 2685 ret->name = g_strdup("IRC"); |
2675 ret->list_icon = irc_list_icon; | 2686 ret->list_icon = irc_list_icon; |
2676 ret->login = irc_login; | 2687 ret->login = irc_login; |
2677 ret->close = irc_close; | 2688 ret->close = irc_close; |
2678 ret->send_im = irc_send_im; | 2689 ret->send_im = irc_send_im; |