Mailto landing (ifdef MOZ_MAIL_COMPOSE). Approved by valeski.

This commit is contained in:
akkana%netscape.com 1998-09-04 18:59:53 +00:00
parent 2474ddbb54
commit 9368d69852
4 changed files with 29 additions and 8 deletions

View File

@ -795,7 +795,9 @@ NET_InitNetLib(int socket_buffer_size, int max_number_of_connections)
#endif #endif
NET_InitTotallyRandomStuffPeopleAddedProtocols(); NET_InitTotallyRandomStuffPeopleAddedProtocols();
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
NET_InitMailtoProtocol(); /* has a stub for MOZ_MAIL_NEWS */ NET_InitMailtoProtocol(); /* has a stub for MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
#ifdef MOZ_MAIL_NEWS #ifdef MOZ_MAIL_NEWS
NET_InitNewsProtocol(); NET_InitNewsProtocol();
NET_InitMailboxProtocol(); NET_InitMailboxProtocol();
@ -4868,7 +4870,7 @@ NET_DestroyEvidence()
NET_SetMemoryCacheSize(oldSize); /* set it back up */ NET_SetMemoryCacheSize(oldSize); /* set it back up */
} }
#ifndef MOZ_MAIL_NEWS #if !defined(MOZ_MAIL_NEWS) && !defined(MOZ_MAIL_COMPOSE)
/* this whole mess should get moved to the mksmtp.c file /* this whole mess should get moved to the mksmtp.c file
* where it can share the InitMailtoProtocol function * where it can share the InitMailtoProtocol function

View File

@ -2386,7 +2386,7 @@ NET_AddLOSubmitDataToURLStruct(LO_FormSubmitData * sub_data,
/* If we're posting to mailto, then generate the full complement /* If we're posting to mailto, then generate the full complement
of mail headers; and allow the url to specify additional headers of mail headers; and allow the url to specify additional headers
as well. */ as well. */
#ifdef MOZ_MAIL_NEWS #if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
if (!PL_strncasecmp(url_struct->address, "mailto:", 7)) if (!PL_strncasecmp(url_struct->address, "mailto:", 7))
{ {
#ifdef MOZILLA_CLIENT #ifdef MOZILLA_CLIENT
@ -2413,7 +2413,7 @@ NET_AddLOSubmitDataToURLStruct(LO_FormSubmitData * sub_data,
PR_ASSERT(0); PR_ASSERT(0);
#endif /* MOZILLA_CLIENT */ #endif /* MOZILLA_CLIENT */
} }
#endif /* MOZ_MAIL_NEWS */ #endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
if(encoding && !PL_strcasecmp(encoding, "text/plain")) if(encoding && !PL_strcasecmp(encoding, "text/plain"))
{ {
@ -3418,7 +3418,7 @@ NET_InitWAISProtocol(void)
NET_RegisterProtocolImplementation(&wais_proto_impl, WAIS_TYPE_URL); NET_RegisterProtocolImplementation(&wais_proto_impl, WAIS_TYPE_URL);
} }
#ifdef MOZ_MAIL_NEWS #if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
PUBLIC char * PUBLIC char *
NET_Base64Encode (char *src, int32 srclen) NET_Base64Encode (char *src, int32 srclen)
@ -3485,7 +3485,7 @@ NET_Base64Decode (char *src,
return bs.buffer; return bs.buffer;
} }
#endif /* MOZ_MAIL_NEWS */ #endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
/* A utility function to fetch a file from cache right away, /* A utility function to fetch a file from cache right away,
* and update it (from the original server) after its used. * and update it (from the original server) after its used.

View File

@ -50,6 +50,12 @@ DIRS += \
imap4 \ imap4 \
certld \ certld \
$(NULL) $(NULL)
else
ifdef MOZ_MAIL_COMPOSE
DIRS += \
smtp \
$(NULL)
endif
endif endif
DIRS += http DIRS += http

View File

@ -543,15 +543,17 @@ net_smtp_auth_login_response(ActiveEntry *cur_entry)
switch (CD_RESPONSE_CODE/100) { switch (CD_RESPONSE_CODE/100) {
case 2: case 2:
{ {
#ifdef MOZ_MAIL_NEWS
char *pop_password = (char *)NET_GetPopPassword(); char *pop_password = (char *)NET_GetPopPassword();
CD_NEXT_STATE = SMTP_SEND_HELO_RESPONSE; CD_NEXT_STATE = SMTP_SEND_HELO_RESPONSE;
if (pop_password == NULL) if (pop_password == NULL)
NET_SetPopPassword2(net_smtp_password); NET_SetPopPassword2(net_smtp_password);
#ifdef MOZ_MAIL_NEWS
if ( IMAP_GetPassword() == NULL ) if ( IMAP_GetPassword() == NULL )
IMAP_SetPassword(net_smtp_password); IMAP_SetPassword(net_smtp_password);
#endif /* MOZ_MAIL_NEWS */
XP_FREEIF(pop_password); XP_FREEIF(pop_password);
#else /* MOZ_MAIL_NEWS */
XP_ASSERT(0);
#endif /* MOZ_MAIL_NEWS */
} }
break; break;
case 3: case 3:
@ -565,7 +567,7 @@ net_smtp_auth_login_response(ActiveEntry *cur_entry)
char *username = 0; char *username = 0;
char host[256]; char host[256];
int len = 256; int len = 256;
#endif; #endif
/* NET_GetPopUsername () returns pointer to the cached /* NET_GetPopUsername () returns pointer to the cached
* username. It did *NOT* alloc a new string * username. It did *NOT* alloc a new string
*/ */
@ -656,7 +658,9 @@ net_smtp_auth_login_password(ActiveEntry *cur_entry)
if (!net_smtp_password || !*net_smtp_password) { if (!net_smtp_password || !*net_smtp_password) {
XP_FREEIF(net_smtp_password); /* in case its an empty string */ XP_FREEIF(net_smtp_password); /* in case its an empty string */
#ifdef MOZ_MAIL_NEWS
net_smtp_password = (char *) NET_GetPopPassword(); net_smtp_password = (char *) NET_GetPopPassword();
#endif /* MOZ_MAIL_NEWS */
} }
if (!net_smtp_password || !*net_smtp_password) { if (!net_smtp_password || !*net_smtp_password) {
@ -1304,10 +1308,12 @@ HG61365
encrypt_p, sign_p, force_plain_text, encrypt_p, sign_p, force_plain_text,
html_part); html_part);
#ifdef MOZ_MAIL_NEWS
if (cpane && CE_URL_S->fe_data) { if (cpane && CE_URL_S->fe_data) {
/* Tell libmsg what to do after deliver the message */ /* Tell libmsg what to do after deliver the message */
MSG_SetPostDeliveryActionInfo (cpane, CE_URL_S->fe_data); MSG_SetPostDeliveryActionInfo (cpane, CE_URL_S->fe_data);
} }
#endif /* MOZ_MAIL_NEWS */
FREEIF(from); FREEIF(from);
FREEIF(reply_to); FREEIF(reply_to);
@ -1679,6 +1685,13 @@ Subject: %s\n\
} }
#ifndef MOZ_MAIL_NEWS
PUBLIC const char*
NET_GetPopUsername ()
{
return 0;
}
#endif /* MOZ_MAIL_NEWS */
#endif /* defined(MOZILLA_CLIENT) || defined(LIBNET_SMTP) */ #endif /* defined(MOZILLA_CLIENT) || defined(LIBNET_SMTP) */