lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev [PATCH] remove extension to EXTERNAL command, extend CERN r


From: Klaus Weide
Subject: Re: lynx-dev [PATCH] remove extension to EXTERNAL command, extend CERN rules support for mailto: URLs
Date: Fri, 7 Jul 2000 13:24:54 -0500 (CDT)

On Fri, 7 Jul 2000, Klaus Weide wrote:

> See code appended to this message.

... and then forgot to append it.

Necessary changes to let access to "mailto:"; URLs (via ACTIVATE and
similar keys) be handled in a generic way.  This is minimally tested.

 - Remove (comment out) 'if (url_type == MAILTO_URL_TYPE) {' ... code
   in LYGetFile.c.
 - Register LYLynxMailto as a protocol handler in LYMain.c.
   Just find the three lines that refer to LYLynxStatusMessages,
   and duplicate each replacing LYLynxStatusMessages with LYLynxMailto.
 - LYMail.c needs some includes added at the top, at least HTAccess.h
   and possibly LYCharUtils.h.
 - The code below may use some function (LYStrHas8bit()?) that I invented
   in my current code... get rid of it if that's the case, just make the
   logic the same as in current getfile().
 - append at end of LYMail.c:

PRIVATE int LYLoadMailto ARGS4(
        CONST char *,           arg,
        HTParentAnchor *,       anAnchor,
        HTFormat,               format_out GCC_UNUSED,
        HTStream*,              sink GCC_UNUSED)
{
    if (no_mail) {
        HTUserMsg(MAIL_DISABLED);
        HTNoDataOK = 1;
        return HT_NOT_LOADED;
    } else {
        CONST char *title;
        char *tmptitle = NULL;

        title = "";
        if (HTAnchor_title(anAnchor)) {
            title = HTAnchor_title(anAnchor);
        } else if (HTMainAnchor && !LYUserSpecifiedURL) {
            title = HTAnchor_subject(HTMainAnchor);
            if (title && *title) {
                if (strncasecomp(title, "Re:", 3) ||
                    LYStrHas8bit(title)) {
                    if (strncasecomp(title, "Re:", 3))
                        StrAllocCopy(tmptitle, "Re: ");
                    StrAllocCat(tmptitle, title);
                    LYUCFullyTranslateString(&tmptitle,
                                             HTMainText_Get_UCLYhndl(),
                                             current_char_set,
                                             FALSE,
                                             NO, TRUE, FALSE,
                                             NO, st_other);
                    title = tmptitle;
                }
            } else {
                title = "";
            }
        }
        reply_by_mail((char *)strchr(arg,':')+1,
                      ((HTMainAnchor && !LYUserSpecifiedURL) ?
                       (char *)HTMainAnchor->address :
                       (char *)anAnchor->address),
                      title,
                      (HTMainAnchor && !LYUserSpecifiedURL) ?
                      HTMainAnchor->message_id : NULL);
        FREE(tmptitle);
    }
    HTNoDataOK = 1;
    return(HT_NO_DATA);
}


#ifdef GLOBALDEF_IS_MACRO
#define _LYMAILTO_C_GLOBALDEF_1_INIT { "mailto",LYLoadMailto,0}
GLOBALDEF (HTProtocol,LYLynxMailto,_LYMAILTO_C_GLOBALDEF_1_INIT);
#else
GLOBALDEF PUBLIC HTProtocol LYLynxMailto = {"mailto",LYLoadMailto,0};
#endif /* GLOBALDEF_IS_MACRO */


; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]