-#ifdef USE_NNTP
- if (option (OPTNEWS)) {
- string_list_t *l = CurrentNewsSrv->list;
-
- m_strcpy(filepart, sizeof(filepart), s);
-
- /*
- * special case to handle when there is no filepart yet.
- * find the first subscribed newsgroup
- */
- if ((len = m_strlen(filepart)) == 0) {
- for (; l; l = l->next) {
- NNTP_DATA *data = (NNTP_DATA *) l->data;
-
- if (data && data->subscribed) {
- m_strcpy(filepart, sizeof(filepart), data->group);
- init++;
- l = l->next;
- break;
- }
- }
- }
-
- for (; l; l = l->next) {
- NNTP_DATA *data = (NNTP_DATA *) l->data;
-
- if (data && data->subscribed &&
- m_strncmp(data->group, filepart, len) == 0) {
- if (init) {
- for (i = 0; filepart[i] && data->group[i]; i++) {
- if (filepart[i] != data->group[i]) {
- filepart[i] = 0;
- break;
- }
- }
- filepart[i] = 0;
- }
- else {
- m_strcpy(filepart, sizeof(filepart), data->group);
- init = 1;
- }
- }
- }
-
- strcpy (s, filepart);
-
- return (init ? 0 : -1);
- }
-#endif
-