private void SetWindowTitle(string speaker) { if (String.IsNullOrEmpty(speaker)) { return; } // Find the buddy ImBuddy buddy = null; ImBuddyListReader reader = null; if (client == ImClient.Pidgin) { reader = new PidginBuddyListReader(); buddy = reader.Search(speaker); } else if (client == ImClient.Kopete) { reader = new KopeteBuddyListReader(); buddy = reader.Search(speaker); } else if (client == ImClient.Konversation) { int pos = speaker.IndexOf('_'); // speaker of the form irc.gimp.net_#mono-dev if (pos == -1) { imviewer.Title = String.Format(Catalog.GetString("Conversations in {0}"), speaker); } else { imviewer.Title = String.Format( Catalog.GetString("Conversations in {0} ({1})"), speaker.Substring(pos + 1), speaker.Substring(0, pos)); } speaking_to = speaker; return; } if (speaker.EndsWith(".chat")) { imviewer.Title = String.Format(Catalog.GetString("Conversations in {0}"), speaker.Replace(".chat", String.Empty)); } else { string nick = speaker; if (buddy != null && !String.IsNullOrEmpty(buddy.Alias)) { nick = buddy.Alias; } imviewer.Title = String.Format(Catalog.GetString("Conversations with {0}"), nick); } speaking_to = speaker; }
///////////////////////////////////////////////// protected override bool HitFilter(Hit hit) { string speakingto = hit ["fixme:speakingto"]; // We have no idea who we're speaking to. Bad, but we // still want to present it. if (String.IsNullOrEmpty(speakingto)) { return(true); } ImBuddy buddy = list.Search(speakingto); // We might still want to see a chat even if someone's // not on our buddy list. if (buddy == null) { return(true); } if (!String.IsNullOrEmpty(buddy.Alias)) { hit.AddProperty(Property.NewKeyword("fixme:speakingto_alias", buddy.Alias)); } if (!String.IsNullOrEmpty(buddy.BuddyIconLocation)) { hit.AddProperty(Property.NewUnsearched("fixme:speakingto_icon", buddy.BuddyIconLocation)); } return(true); }
protected override bool HitFilter(Hit hit) { ImBuddy buddy = list.Search(hit ["fixme:speakingto"]); if (buddy != null) { if (!String.IsNullOrEmpty(buddy.Alias)) { hit ["fixme:speakingto_alias"] = buddy.Alias; } // FIXME: Icons? } return(true); }
///////////////////////////////////////////////// private Indexable PidginLogToIndexable(string filename) { FileInfo info = new FileInfo(filename); Uri uri = UriFu.PathToFileUri(filename); Indexable indexable = new Indexable(uri); indexable.ContentUri = uri; indexable.Timestamp = info.LastWriteTimeUtc; indexable.MimeType = "beagle/x-pidgin-log"; indexable.HitType = "IMLog"; indexable.CacheContent = false; ImBuddy buddy = queryable.ImBuddyListReader.Search(info.Directory.Name); if (buddy != null && !String.IsNullOrEmpty(buddy.Alias)) { indexable.AddProperty(Property.NewKeyword("fixme:alias", buddy.Alias)); } return(indexable); }