+2001-05-22 [paul]
+
+ 0.4.99claws2
+
+ * sync with sylpheed 0.4.99cvs2
+ * src/news.[ch]
+ * src/nntp.[ch]
+ * INSTALL
+ * INSTALL.jp
+
2001-05-22 [alfons]
* src/summaryview.c: bugfixed a premature assignment in summaryview_add_sender_to_cb()
0.4.99claws1
- *sync with sylpheed 0.4.99cvs1
+ * sync with sylpheed 0.4.99cvs1
2001-05-18 [hoa]
o RedHat Linux 6.1 + Helix GNOME (glibc 2.1.x)
o RedHat Linux 6.2 / 6.2J (glibc 2.1.x)
o RedHat Linux 7.0 / 7.0J
+o RedHat Linux 7.1
o LinuxPPC2000 + Yukikaze(Japanization kit)
o Linux2000G (Intel / PPC)
o HOLON Linux 2.0 (Intel / PPC)
o Linux Mandrake 7.0
o Linux Mandrake 7.1
o Linux Mandrake 7.2
-o Linux Mandrake 8.0 beta
+o Linux Mandrake 8.0
o SuSE Linux 6.3 (glibc 2.1.2)
o SuSE Linux 6.4
o SuSE Linux 7.0
If you want to enable multithread support, append the option
--enable-threads after ./configure.
-Notice: Multithread support is still in an experimental stage, and it
- doesn't work correctly.
+WARNING: Multithread support is still in an experimental stage, and it
+ DOESN'T work correctly. DON'T use it unless you want to hack it.
If you want to enable IPv6 support, append the option
--enable-ipv6 after ./configure.
and append the option --enable-gpgme after ./configure.
-Warning: the GnuPG support is still in the development stage, and it
+WARNING: the GnuPG support is still in the development stage, and it
may not work correctly. I suggest never to use a real key.
Please use sample keys.
o RedHat Linux 6.1 + Helix GNOME (glibc 2.1.x)
o RedHat Linux 6.2 / 6.2J (glibc 2.1.x)
o RedHat Linux 7.0 / 7.0J
+o RedHat Linux 7.1
o LinuxPPC2000 + ÀãÉ÷(ÆüËܸ첽 kit)
o Linux2000G (Intel / PPC)
o HOLON Linux 2.0 (Intel / PPC)
o Linux Mandrake 7.0
o Linux Mandrake 7.1
o Linux Mandrake 7.2
-o Linux Mandrake 8.0 beta
+o Linux Mandrake 8.0
o SuSE Linux 6.3 (glibc 2.1.2)
o SuSE Linux 6.4
o SuSE Linux 7.0
¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÂбþ¤ò͸ú¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢ ./configure ¤Î¸å¤Ë
--enable-threads ¥ª¥×¥·¥ç¥ó¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£
-Ãí°Õ: ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÂбþ¤Ï¤Þ¤À¼Â¸³Ãʳ¬¤Ç¤¢¤ê¡¢Àµ¤·¤¯Æ°ºî¤·¤Þ¤»¤ó¡£
+·Ù¹ð: ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÂбþ¤Ï¤Þ¤À¼Â¸³Ãʳ¬¤Ç¤¢¤ê¡¢Àµ¤·¤¯Æ°ºî¤·¤Þ¤»¤ó¡£
+ hack ¤·¤¿¤¤¤Î¤Ç¤Ê¤±¤ì¤Ð¡¢»ÈÍѤ·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
IPv6 Âбþ¤ò͸ú¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢ ./configure ¤Î¸å¤Ë
--enable-ipv6 ¥ª¥×¥·¥ç¥ó¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£
MICRO_VERSION=99
INTERFACE_AGE=99
BINARY_AGE=99
-EXTRA_VERSION=claws1
+EXTRA_VERSION=claws2
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "inputdialog.h"
#include "alertpanel.h"
+static Session *news_session_new (const gchar *server,
+ gushort port,
+ const gchar *userid,
+ const gchar *passwd);
+
static gint news_get_article_cmd (NNTPSession *session,
const gchar *cmd,
gint num,
gchar *filename);
static gint news_select_group (NNTPSession *session,
- const char *group);
+ const gchar *group);
static GSList *news_get_uncached_articles(NNTPSession *session,
FolderItem *item,
gint cache_last,
gint *rfirst,
gint *rlast);
static MsgInfo *news_parse_xover (const gchar *xover_str);
-static gchar * news_parse_xhdr (const gchar *xover_str,
- MsgInfo * info);
+static gchar *news_parse_xhdr (const gchar *xhdr_str,
+ MsgInfo *msginfo);
static GSList *news_delete_old_article (GSList *alist,
gint first);
static void news_delete_all_article (FolderItem *item);
g_free(session->group);
}
-static gchar *news_query_password(const gchar *server,
- const gchar *user)
+static gchar *news_query_password(const gchar *server, const gchar *user)
{
gchar *message;
gchar *pass;
message = g_strdup_printf(_("Input password for %s on %s:"),
user, server);
-
- pass = input_dialog_with_invisible(_("Input password"),
- message, NULL);
+ pass = input_dialog_with_invisible(_("Input password"), message, NULL);
g_free(message);
-/* manage_window_focus_in(inc_dialog->mainwin->window, */
-/* NULL, NULL); */
+
return pass;
}
{
Session *session;
PrefsAccount *ac;
- const gchar *userid;
- gchar *passwd;
+ const gchar *userid = NULL;
+ gchar *passwd = NULL;
ac = folder->account;
if (ac->use_nntp_auth && ac->userid && ac->userid[0]) {
userid = ac->userid;
if (ac->passwd && ac->passwd[0])
passwd = g_strdup(ac->passwd);
- else {
+ else
passwd = news_query_password(ac->nntp_server, userid);
- if (!passwd)
- userid = NULL;
- }
- } else {
- userid = passwd = NULL;
}
+
session = news_session_new(ac->nntp_server, 119, userid, passwd);
g_free(passwd);
+
return session;
}
* news_select_group:
* @session: Active NNTP session.
* @group: Newsgroup name.
- *
+ *
* Select newsgroup @group with the GROUP command if it is not already
* selected in @session.
- *
+ *
* Return value: NNTP result code.
**/
-static gint news_select_group(NNTPSession *session,
- const char *group)
+static gint news_select_group(NNTPSession *session, const gchar *group)
{
gint ok;
gint num, first, last;
- if (g_strcasecmp(session->group, group) == 0)
+ if (session->group && g_strcasecmp(session->group, group) == 0)
return NN_SUCCESS;
g_free(session->group);
session->group = NULL;
ok = nntp_group(session->nntp_sock, group, &num, &first, &last);
-
if (ok == NN_SUCCESS)
session->group = g_strdup(group);
log_warning(_("can't set group: %s\n"), item->path);
return NULL;
}
-
session->group = g_strdup(item->path);
/* calculate getting overview range */
begin = cache_last + 1;
end = last;
+ if (rfirst) *rfirst = first;
+ if (rlast) *rlast = last;
+
if (prefs_common.max_articles > 0 &&
end - begin + 1 > prefs_common.max_articles)
begin = end - prefs_common.max_articles + 1;
if (nntp_xhdr(session->nntp_sock, "to", begin, end) != NN_SUCCESS) {
log_warning(_("can't get xhdr\n"));
- return NULL;
+ return newlist;
}
llast = newlist;
for (;;) {
- gchar * value;
-
if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) {
- log_warning(_("error occurred while getting xover.\n"));
+ log_warning(_("error occurred while getting xhdr.\n"));
return newlist;
}
if (buf[0] == '.' && buf[1] == '\r') break;
+ if (!llast) {
+ g_warning("llast == NULL\n");
+ continue;
+ }
- msginfo = (MsgInfo *) llast->data;
-
- value = news_parse_xhdr(buf, msginfo);
-
- if (value)
- msginfo->to = value;
+ msginfo = (MsgInfo *)llast->data;
+ msginfo->to = news_parse_xhdr(buf, msginfo);
llast = llast->next;
-
}
if (nntp_xhdr(session->nntp_sock, "cc", begin, end) != NN_SUCCESS) {
log_warning(_("can't get xhdr\n"));
- return NULL;
+ return newlist;
}
llast = newlist;
for (;;) {
- gchar * value;
-
if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) {
- log_warning(_("error occurred while getting xover.\n"));
+ log_warning(_("error occurred while getting xhdr.\n"));
return newlist;
}
if (buf[0] == '.' && buf[1] == '\r') break;
+ if (!llast) {
+ g_warning("llast == NULL\n");
+ continue;
+ }
- msginfo = (MsgInfo *) llast->data;
-
- value = news_parse_xhdr(buf, msginfo);
-
- if (value)
- msginfo->cc = value;
+ msginfo = (MsgInfo *)llast->data;
+ msginfo->cc = news_parse_xhdr(buf, msginfo);
llast = llast->next;
}
- if (rfirst) *rfirst = first;
- if (rlast) *rlast = last;
return newlist;
}
return msginfo;
}
-static gchar * news_parse_xhdr(const gchar *xover_str, MsgInfo * info)
+static gchar *news_parse_xhdr(const gchar *xhdr_str, MsgInfo *msginfo)
{
gchar buf[NNTPBUFSIZE];
gchar *p;
+ gchar *tmp;
gint num;
- gchar * tmp;
- p = strchr(xover_str, ' ');
+ p = strchr(xhdr_str, ' ');
if (!p)
return NULL;
else
p++;
- num = atoi(xover_str);
-
- if (info->msgnum != num)
- return NULL;
+ num = atoi(xhdr_str);
+ if (msginfo->msgnum != num) return NULL;
tmp = strchr(p, '\r');
if (!tmp) tmp = strchr(p, '\n');
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
static gint verbose = 1;
-static void nntp_gen_send(NNTPSockInfo *sock, const gchar *format, ...);
-static gint nntp_gen_recv(NNTPSockInfo *sock, gchar *buf, gint size);
-static gint nntp_gen_command(NNTPSockInfo *sock, gchar *argbuf,
- const gchar *format, ...);
+static void nntp_gen_send (NNTPSockInfo *sock,
+ const gchar *format,
+ ...);
+static gint nntp_gen_recv (NNTPSockInfo *sock,
+ gchar *buf,
+ gint size);
+static gint nntp_gen_command (NNTPSockInfo *sock,
+ gchar *argbuf,
+ const gchar *format,
+ ...);
NNTPSockInfo *nntp_open(const gchar *server, gushort port, gchar *buf)
{
SockInfo *sock;
NNTPSockInfo *nntp_sock;
- nntp_sock = g_new0(NNTPSockInfo, 1);
if ((sock = sock_connect(server, port)) == NULL) {
log_warning(_("Can't connect to NNTP server: %s:%d\n"),
server, port);
- g_free(nntp_sock);
return NULL;
}
+ nntp_sock = g_new0(NNTPSockInfo, 1);
nntp_sock->sock = sock;
if (nntp_ok(nntp_sock, buf) == NN_SUCCESS)
NNTPSockInfo *sock;
sock = nntp_open(server, port, buf);
- if (!sock)
- return NULL;
+ if (!sock) return NULL;
+
sock->userid = g_strdup(userid);
sock->passwd = g_strdup(passwd);
+
return sock;
}
-
void nntp_close(NNTPSockInfo *sock)
{
- if (!sock)
- return;
+ if (!sock) return;
sock_close(sock->sock);
- g_free(sock->passwd);
g_free(sock->userid);
+ g_free(sock->passwd);
g_free(sock);
}
return NN_SUCCESS;
}
-gint nntp_get_article(NNTPSockInfo *sock, const gchar *cmd, gint num, gchar **msgid)
+gint nntp_get_article(NNTPSockInfo *sock, const gchar *cmd, gint num,
+ gchar **msgid)
{
gint ok;
gchar buf[NNTPBUFSIZE];
return NN_SUCCESS;
}
-gint nntp_xhdr(NNTPSockInfo *sock, gchar * header, gint first, gint last)
+gint nntp_xhdr(NNTPSockInfo *sock, const gchar *header, gint first, gint last)
{
gint ok;
gchar buf[NNTPBUFSIZE];
return NN_SUCCESS;
}
+gint nntp_list(NNTPSockInfo *sock)
+{
+ return nntp_gen_command(sock, NULL, "LIST");
+}
+
gint nntp_post(NNTPSockInfo *sock, FILE *fp)
{
gint ok;
gint ok;
if (sock->auth_failed)
- return NN_AUTHREQ; /* force reconnection */
+ return NN_AUTHREQ;
ok = nntp_gen_command(sock, NULL, "MODE %s",
stream ? "STREAM" : "READER");
if (!strncmp(buf, "381 ", 4))
return NN_AUTHCONT;
+
return NN_SUCCESS;
} else if (!strncmp(buf, "480 ", 4))
return NN_AUTHREQ;
gint ok;
va_start(args, format);
- g_vsnprintf(buf, sizeof(buf) - 2, format, args);
+ g_vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
nntp_gen_send(sock, "%s", buf);
sock->auth_failed = TRUE;
return ok;
}
+
nntp_gen_send(sock, "AUTHINFO USER %s", sock->userid);
ok = nntp_ok(sock, NULL);
if (ok == NN_AUTHCONT) {
sock->auth_failed = TRUE;
return ok;
}
+
nntp_gen_send(sock, "%s", buf);
ok = nntp_ok(sock, argbuf);
}
- return ok;
-}
-/*
- nntp_list sends the command "LIST" to the news server,
- a function is needed to read the newsgroups list.
- */
-
-gint nntp_list(NNTPSockInfo *sock)
-{
- return nntp_gen_command(sock, NULL, "LIST");
+ return ok;
}
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
typedef struct _NNTPSockInfo NNTPSockInfo;
+struct _NNTPSockInfo
+{
+ SockInfo *sock;
+
+ gchar *userid;
+ gchar *passwd;
+ gboolean auth_failed;
+};
+
#define NN_SUCCESS 0
#define NN_SOCKET 2
#define NN_AUTHFAIL 3
#define NNTPBUFSIZE 8192
-struct _NNTPSockInfo
-{
- SockInfo *sock;
- gchar *userid;
- gchar *passwd;
- gboolean auth_failed;
-};
-
-NNTPSockInfo *nntp_open(const gchar *server, gushort port, gchar *buf);
-NNTPSockInfo *nntp_open_auth(const gchar *server, gushort port, gchar *buf,
- const gchar *userid, const gchar *passwd);
-void nntp_close(NNTPSockInfo *sock);
-gint nntp_group(NNTPSockInfo *sock, const gchar *group,
- gint *num, gint *first, gint *last);
-gint nntp_get_article(NNTPSockInfo *sock, const gchar *cmd, gint num, gchar **msgid);
-gint nntp_article(NNTPSockInfo *sock, gint num, gchar **msgid);
-gint nntp_body(NNTPSockInfo *sock, gint num, gchar **msgid);
-gint nntp_head(NNTPSockInfo *sock, gint num, gchar **msgid);
-gint nntp_stat(NNTPSockInfo *sock, gint num, gchar **msgid);
-gint nntp_next(NNTPSockInfo *sock, gint *num, gchar **msgid);
-gint nntp_xover(NNTPSockInfo *sock, gint first, gint last);
-gint nntp_post(NNTPSockInfo *sock, FILE *fp);
-gint nntp_newgroups(NNTPSockInfo *sock);
-gint nntp_newnews(NNTPSockInfo *sock);
-gint nntp_mode(NNTPSockInfo *sock, gboolean stream);
-gint nntp_ok(NNTPSockInfo *sock, gchar *argbuf);
-gint nntp_list(NNTPSockInfo *sock);
-gint nntp_xhdr(NNTPSockInfo *sock, gchar * header, gint first, gint last);
+NNTPSockInfo *nntp_open (const gchar *server,
+ gushort port,
+ gchar *buf);
+NNTPSockInfo *nntp_open_auth (const gchar *server,
+ gushort port,
+ gchar *buf,
+ const gchar *userid,
+ const gchar *passwd);
+void nntp_close (NNTPSockInfo *sock);
+gint nntp_group (NNTPSockInfo *sock,
+ const gchar *group,
+ gint *num,
+ gint *first,
+ gint *last);
+gint nntp_get_article (NNTPSockInfo *sock,
+ const gchar *cmd,
+ gint num,
+ gchar **msgid);
+gint nntp_article (NNTPSockInfo *sock,
+ gint num,
+ gchar **msgid);
+gint nntp_body (NNTPSockInfo *sock,
+ gint num,
+ gchar **msgid);
+gint nntp_head (NNTPSockInfo *sock,
+ gint num,
+ gchar **msgid);
+gint nntp_stat (NNTPSockInfo *sock,
+ gint num,
+ gchar **msgid);
+gint nntp_next (NNTPSockInfo *sock,
+ gint *num,
+ gchar **msgid);
+gint nntp_xover (NNTPSockInfo *sock,
+ gint first,
+ gint last);
+gint nntp_xhdr (NNTPSockInfo *sock,
+ const gchar *header,
+ gint first,
+ gint last);
+gint nntp_list (NNTPSockInfo *sock);
+gint nntp_post (NNTPSockInfo *sock,
+ FILE *fp);
+gint nntp_newgroups (NNTPSockInfo *sock);
+gint nntp_newnews (NNTPSockInfo *sock);
+gint nntp_mode (NNTPSockInfo *sock,
+ gboolean stream);
+gint nntp_ok (NNTPSockInfo *sock,
+ gchar *argbuf);
#endif /* __NNTP_H__ */