aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-url.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-03-31 02:05:48 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-03-31 02:05:48 +0800
commit2067796514a4273959cc478a252932f6db1b2d2d (patch)
tree3fecced618ee8e85f6f742145f46d2b5eb46ab7c /e-util/e-url.c
parentc2f952971ba1362587fa6b9ed5e4b916e14d13ab (diff)
downloadgsoc2013-evolution-2067796514a4273959cc478a252932f6db1b2d2d.tar.gz
gsoc2013-evolution-2067796514a4273959cc478a252932f6db1b2d2d.tar.zst
gsoc2013-evolution-2067796514a4273959cc478a252932f6db1b2d2d.zip
Add support for converting e-mail addresses to links. (is_email_address):
2001-03-30 Jon Trowbridge <trow@ximian.com> * e-html-utils.c (e_text_to_html_full): Add support for converting e-mail addresses to links. (is_email_address): Added. Identifies e-mail addresses. (email_address_extract): Added. Extracts a copy of the e-mail address from the text. * e-html-utils.h (E_TEXT_TO_HTML_CONVERT_ADDRESSES): Added. * e-url.c (e_url_shroud): Added. Copy a url, replacing any plaintext passwords with a single *. (e_url_equal): Compare two urls, taking into account that they may or may not be shrouded. 2001-03-30 Jon Trowbridge <trow@ximian.com> * camel-mime-message.c (camel_mime_message_set_source): Shrould our source URL before putting it into X-Evolution-Source. 2001-03-30 Jon Trowbridge <trow@ximian.com> * mail-display.c (mail_text_write): Add (commented-out) E_TEXT_TO_HTML_CONVERT_ADDRESSES. * mail-config.c (mail_config_get_account_by_source_url): Call e_url_equal to compare URLs. svn path=/trunk/; revision=9050
Diffstat (limited to 'e-util/e-url.c')
-rw-r--r--e-util/e-url.c90
1 files changed, 90 insertions, 0 deletions
diff --git a/e-util/e-url.c b/e-util/e-url.c
new file mode 100644
index 0000000000..ffebba7827
--- /dev/null
+++ b/e-util/e-url.c
@@ -0,0 +1,90 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * e-url.c
+ *
+ * Copyright (C) 2001 Ximian, Inc.
+ *
+ * Developed by Jon Trowbridge <trow@ximian.com>
+ */
+
+/*
+ * 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 the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA.
+ */
+
+#include <config.h>
+#include <string.h>
+#include "e-url.h"
+
+char *
+e_url_shroud (const char *url)
+{
+ const char *first_colon = NULL;
+ const char *last_at = NULL;
+ const char *p;
+ char *shrouded;
+
+ if (url == NULL)
+ return NULL;
+
+ /* Skip past the moniker */
+ for (p = url; *p && *p != ':'; ++p);
+ if (*p)
+ ++p;
+
+ while (*p) {
+ if (first_colon == NULL && *p == ':')
+ first_colon = p;
+ if (*p == '@')
+ last_at = p;
+ ++p;
+ }
+
+ if (first_colon && last_at) {
+ shrouded = g_strdup_printf ("%.*s*%s", first_colon - url + 1, url, last_at);
+ } else {
+ shrouded = g_strdup (url);
+ }
+
+ g_message ("shrouded [%s] to [%s]", url, shrouded);
+
+ return shrouded;
+}
+
+gboolean
+e_url_equal (const char *url1, const char *url2)
+{
+ char *shroud1 = e_url_shroud (url1);
+ char *shroud2 = e_url_shroud (url2);
+ gint len1, len2;
+ gboolean rv;
+
+ if (shroud1 == NULL || shroud2 == NULL) {
+ rv = (shroud1 == shroud2);
+ } else {
+ len1 = strlen (shroud1);
+ len2 = strlen (shroud2);
+
+ rv = !strncmp (shroud1, shroud2, MIN (len1, len2));
+ }
+
+ g_free (shroud1);
+ g_free (shroud2);
+
+ g_message ("[%s] and [%s] are%s equal", url1, url2, rv ? "" : " NOT");
+
+ return rv;
+}
stlme2013-07-062-7/+3 * Update the KDE Software Compilation to 4.10.5.rakuco2013-07-051-2/+2 * Update to KDE SC 4.10.4, proudly presented by the KDE on FreeBSD team.rakuco2013-07-031-2/+2 * New ports for bugzilla44ohauer2013-06-216-0/+339 * Update to 4.0.4.jkim2013-06-201-4/+4 * Update to version 4.5.12.bsam2013-06-101-2/+2 * - update bugzilla42 to version 4.2.6 (bugfix release)ohauer2013-05-242-3/+3 * - Update MASTER_SITES and COMMENTwen2013-05-191-3/+4 * KDE/FreeBSD team presents KDE SC 4.10.3 ports!makc2013-05-192-4/+3 * Update to 4.0.3.jkim2013-05-101-4/+4 * - Update to 2013.05.05sunpoet2013-05-082-3/+3 * Add some shebangfix to allow building most of the ports tree without /usr/bin...bapt2013-05-071-5/+2 * Chase textproc/libebml, multimedia/libmatroska update.ehaupt2013-05-071-1/+1 * Update to 3.18.stefan2013-04-274-19/+78 * - Convert USE_GETTEXT to USES (part 2)ak2013-04-241-1/+1 * Update to version 4.5.10.bsam2013-04-231-2/+2 * Update to 4.0.2.jkim2013-04-171-4/+4 * - Update Calligra and l10n ports to 2.6.2:avilla2013-03-302-7/+5 * KDE/FreeBSD team presents KDE SC 4.10.1 ports!makc2013-03-274-36/+45 * Update to version 4.5.9.bsam2013-03-112-3/+2 * Update to 4.0.1.jkim2013-03-091-4/+4 * - remove german, french and japanese localization of www/MT. They wererm2013-02-243-22/+0 * - update german bugzilla templatesohauer2013-02-216-9/+9 * Merge from area51 repository:makc2013-02-052-3/+3 * Update to 3.6.5.jkim2013-02-051-4/+4 * KDE/FreeBSD team presents KDE SC 4.9.5 ports!makc2013-02-044-32/+242 * Bump PORTREVISON after devel/py-sip and devel/qscintilla2 update.makc2013-02-041-1/+1 * Update to 3.5.1.delphij2013-01-302-5/+4 * Bump PORTREVISION after DESKTOP_ENTRIES updatemakc2013-01-231-0/+1 * - Update to 3.1.0lme2013-01-183-7/+13 * - Change MAINTAINER addresstabthorpe2013-01-102-10/+2 * Fix pkg-descr, this is a KDE4 port, not a KDE3 one.rakuco2012-12-311-1/+1 * - Deprecate QT3, KDE3 and unmaintained ports depending on them. QT 3.3.8beat2012-12-302-0/+6 * - Reassign to the heap at maintainer's requesttabthorpe2012-12-291-6/+2 * 2012-11-27 java/jmp: Java 1.5 is EOLedbapt2012-11-285-71/+0 * - update german and russian bugzilla templates to official new versionsohauer2012-11-169-240/+21 * - fix german bugzilla templates (security fixes)ohauer2012-11-156-13/+231 * Remove the patch to poll.C (note the uppercase .C extension). It is an_hibma2012-11-011-11/+0 * - Update to 3.5.7.jkim2012-10-272-9/+4 * Deprecate a bunch of ports that are either abandonware and/or for which no morebapt2012-10-261-0/+3 * Update to version 4.5.7. This along with fixing other bugs shouldbsam2012-10-152-2/+3 * - Update to 3.4.2swills2012-10-143-11/+10 * - cleanup commentsdinoex2012-10-134-19/+0 * - Update to 2012.10.07sunpoet2012-10-132-3/+3 * - Update to 2012.09.07sunpoet2012-10-092-3/+3 * . update to version 4.5.6;bsam2012-10-032-7/+3 * - Update to 2012.09.30sunpoet2012-10-012-8/+4 * Add trytond_account_de_skr03 2.4.0, the SKR03 chart of account which isbsam2012-09-195-0/+47 * - Update Calligra Suite to 2.5.2.avilla2012-09-171-2/+2 * - Update to 2012.09.09sunpoet2012-09-112-3/+3 * - update bugzilla language tempatesohauer2012-09-067-133/+22 * Update to latest versionscrees2012-09-042-3/+3 * - update bugzilla bugzilla3 and bugzilla42ohauer2012-09-024-18/+130 * - Update Calligra to 2.5.1.avilla2012-09-012-7/+2 * The KDE/FreeBSD team is pleased to announce version 2.5 of Calligra,avilla2012-08-262-16/+6 * - Update to 3.5.6.jkim2012-08-241-4/+4 * - Update to 2012.08.19sunpoet2012-08-202-3/+3 * - Update to 2012.08.12sunpoet2012-08-142-3/+3 * - Update to 2012.08.05sunpoet2012-08-072-3/+3 * - Update to 3.0.0lme2012-08-044-30/+24 * - Fix typos in COMMENTcs2012-08-021-1/+1 * Update to version 4.5.5.bsam2012-07-311-2/+2 * - Update to 2012.07.29sunpoet2012-07-312-3/+3 * Fix typos in COMMENTcs2012-07-297-7/+7 * - update to official versionohauer2012-07-292-11/+3 * - update to official release (just published)ohauer2012-07-297-266/+6 * - patch language templates so they match current bugzilla.ohauer2012-07-295-5/+228 * - new port german/bugzilla42ohauer2012-07-289-6/+378 * - Update to 2012.07.22sunpoet2012-07-232-3/+3 * - Update to 2012.07.15sunpoet2012-07-182-3/+3 * - Update LibreOffice and the language packs to 3.5.5.jkim2012-07-181-4/+4 * - Update to 2012.07.08sunpoet2012-07-092-3/+3 * - Update to 3.4.1sunpoet2012-07-053-11/+9 * - Update Calligra to 2.4.3.avilla2012-07-051-2/+2 * - Update to 2012.07.01sunpoet2012-07-032-3/+3 * - The FreeBSD Office team is proud to announce LibreOffice.org 3.5.4 releasefluffy2012-07-011-4/+4 * - Remove SITE_PERL from *_DEPENDSaz2012-06-301-3/+3 * - Update to 20120607sunpoet2012-06-282-4/+3 * - reset MAINTAINERdinoex2012-06-261-1/+1 * - Update to 2012.06.24sunpoet2012-06-252-3/+3 * Update to version 4.5.4.bsam2012-06-192-3/+2 * - Update to 2012.06.17sunpoet2012-06-182-3/+3 * KDE/FreeBSD team presents KDE SC 4.8.4, probably the last release in 4.8.x se...makc2012-06-153-3/+18 * - Update to 2012.06.10sunpoet2012-06-112-3/+3 * - Convert USE_QT_VER=4 and QT_COMPONETS to USE_QT4miwi2012-06-061-2/+1 * - Update to 2012.05.30sunpoet2012-06-052-3/+3 * - update png to 1.5.10dinoex2012-06-018-5/+8 * - Remove koffice-i18n ports, as they are not very useful withoutavilla2012-05-315-438/+0 * The KDE/FreeBSD team is pleased to announce Calligra Suite 2.4.2, KDEavilla2012-05-319-320/+71 * - Update to 2012.05.27sunpoet2012-05-292-3/+3 * - Update to 3.3.2scheidell2012-05-274-5/+21 * KDE/FreeBSD team presents long awaited KDE SC 4.8.3!makc2012-05-253-16/+96 * Chase PyQT updatemakc2012-05-251-0/+1 * - Update to 2012.05.20sunpoet2012-05-212-3/+3 * - Switch to php53miwi2012-05-171-0/+1 * - Update to 2012.05.13sunpoet2012-05-152-3/+3 * Update to version 4.5.3.bsam2012-05-091-2/+2 * - Update to 2012.05.05sunpoet2012-05-072-3/+3 * - Use USE_DOS2UNIX instead of homemade equivalentak2012-05-061-14/+3 * - Update to 2012.04.29sunpoet2012-04-302-3/+3 * - Update to 2012.04.22sunpoet2012-04-242-3/+3 * - upgrade to 3.5.2bapt2012-04-234-0/+22 * - security update to bugzilla 3.0.9 and 4.0.6ohauer2012-04-222-0/+14 * - update to 4.0.5ohauer2012-04-102-3/+3 * - Update to 2012.04.08sunpoet2012-04-102-3/+3 * Update to version 4.5.2.bsam2012-04-031-2/+2 * - Update to 2012.04.01sunpoet2012-04-022-3/+3 * - Update to 2012.03.25sunpoet2012-03-262-3/+3 * - Update to 2012.03.11sunpoet2012-03-122-3/+3 * - Update to 2012.03.04sunpoet2012-03-05