Email address handling



Hija,

using beagle-cvs, I found some minor "bugs" in the handling of email
addresses.

First off all, when a new evolution editor is opened (by clicking "Send
Mail" in Best), this is started like "evolution mailto:someinfo";. It
happens quite frequently this "someinfo" is a string containing spaces
(eg "John Doo <jdoe beaglerocks com>") or something alike (can't
remember the correct format), but this isnt what should happen, because
then only "John" will be in the "To" field in evo.
Simple fix: add ""'s

Second: looking up email addresses from IM buddies (used by the "Send
Mail" button of an ImLog Tile). Most of my gaim contacts are not in my
evo address book, actually, so when clicking that button, the name of
the last buddy in my address list is always used in the "To" field,
which is pretty annoying.
I fixed this by just using the BuddyAccountName as "email address" when
no "Alias" is set, because some protocols (MSNP, Jabber sometimes,...)
use an email address as account name.
Some room for improvement here: add "@icq.com" if the account happens to
be a numeric Icq account (those addresses exist, right? I'm no icq user)
and other things like this.

Patch which incorporates both things is attached.

For the "Start Im" thing: I got a patch for gaim-remote to be able to
start a conversation with non-aim users too [1], I'll try to extend it a
bit so this can be used with beagle (if wanted, of course). This
functionality should be in gaim-cvs though. I'll do this asap.

Please don't break me down too much now, this is my first Beagle (and C#
under *nix) work...

Regards,

Ikke
http://www.eikke.com

[1]
http://code.eikke.com/index.php?dir=ContactLookupApplet/&file=gaim-1.1.1-remote-open-convo.patch
? emailstuff1.patch
? Util/IrcLog.cs
? beagled/IrssiLogQueryable
Index: Tiles/Tile.cs
===================================================================
RCS file: /cvs/gnome/beagle/Tiles/Tile.cs,v
retrieving revision 1.21
diff -u -b -B -r1.21 Tile.cs
--- Tiles/Tile.cs	15 Jan 2005 05:35:01 -0000	1.21
+++ Tiles/Tile.cs	29 Jan 2005 20:49:55 -0000
@@ -215,12 +215,17 @@
 			p.StartInfo.FileName        = "evolution";
 			p.StartInfo.Arguments       = "mailto:";;
 
+                        //If the email/name combo contains spaces, this will break without " "
+                        p.StartInfo.Arguments += "\"";
+
 			if (email != null && email != "")
 				p.StartInfo.Arguments += email;
 
 			if (attach != null && attach != "")
 				p.StartInfo.Arguments += "?attach=" + attach;
 			
+                        p.StartInfo.Arguments += "\"";
+                        
 			try {
 				p.Start () ;
 			} catch (Exception e) {
Index: Tiles/TileImLog.cs
===================================================================
RCS file: /cvs/gnome/beagle/Tiles/TileImLog.cs,v
retrieving revision 1.26
diff -u -b -B -r1.26 TileImLog.cs
--- Tiles/TileImLog.cs	25 Jan 2005 16:13:40 -0000	1.26
+++ Tiles/TileImLog.cs	29 Jan 2005 20:49:56 -0000
@@ -55,6 +55,12 @@
 			if (buddy != null) {
 				Console.WriteLine ("Found buddy info for {0}, icon at {1}", buddy.Alias, buddy.BuddyIconLocation);
 				email = GetEmailForName (buddy.Alias);
+
+                                if (email == null || email == "")
+                                {
+                                        //This *could* be an email address, which is a good thing (eg MSNP, some Jabber people,...)
+                                        email=buddy.BuddyAccountName;
+                                }
 			}
 		}
 
@@ -100,7 +106,7 @@
 		private string GetEmailForName (string name)
 		{
 #if ENABLE_EVO_SHARP
-			if (name == null)
+			if (name == null || name == "")
 				return null;
 
 			Evolution.Book addressbook = null;


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