Adium

Ticket #8160 (closed defect: fixed)

Opened 9 months ago

Last modified 2 weeks ago

Spotlight display issue for chat logs

Reported by: sanmarcos Assigned to: nobody
Priority: normal Milestone: Adium X 1.2
Component: Logging Version: 1.1.3
Severity: normal Keywords: spotlight search logs
Cc: Patch: Accepted
Pending: 0

Description (Last modified by Catfish_Man)

When trying to search logs in spotlight, I get what you see in the screenshot. Opening the result however does open Adium Log Viewer.

Attachments

spotlight_importer_fixes.diff (16.3 kB) - added by Westacular on 11/05/2007 08:42:06 PM.
Several fixes to Adium's indexing of .chatlog files

Change History

10/22/2007 10:29:07 PM changed by sanmarcos

10/22/2007 10:31:48 PM changed by Catfish_Man

  • description changed.
  • milestone set to Adium X 1.2.

(follow-up: ↓ 5 ) 10/22/2007 10:35:56 PM changed by boredzo

It *works*, in that it finds the log. The bug is in display only.

Also, the display works correctly when the search is for a recipient. Only content searches return the weird display.

10/22/2007 10:39:50 PM changed by boredzo

I think I've figured it out. Search for <message.

It's matching based on the raw XML, not the actual text content. Spotlight is displaying it in that context.

(in reply to: ↑ 3 ) 10/25/2007 09:52:19 PM changed by moehnetiger

Replying to boredzo:

It *works*, in that it finds the log. The bug is in display only.

I do experience a bug when I try to open the search results (.chatlog format):

Doublecliking a .chatlog file in the Adium Log Viewer, which is basically correct, BUT inside the Log Viewer, I'll get the wrong chatlog. I don't get the one I just double-clicked, no... the most recent chatlog is selected instead. So I have to do a second search using the the searchfild inside the Log Viewer.

Also, the display works correctly when the search is for a recipient. Only content searches return the weird display.

Hm... weird, I always, get the same display style in the spotlight search window/or search menu. No matter if I search for contact names, aim/jabber/msn-nicks, chat content or if i just search for <message like you suggestet in an other post: I always get the search result displayed as sender="nickname" on yy-mm-dd

I'm using Adium 1.1.3 and Mac OS X 10.4.10 on a iBook G4 (if that info is important).

10/27/2007 02:44:22 AM changed by sanmarcos

I am using Adium 1.1.3 also, and Mac OS X 10.4.10 on an Aluminum iMac. This seems to be a pretty serious bug to Adium's spotlight plugin.

Thank you.

10/31/2007 04:00:00 PM changed by zacw

  • summary changed from Spotlight searching doesnt work to Spotlight display issue for chat logs.

11/05/2007 03:15:27 PM changed by Westacular

There are several significant bugs in the .chatlog spotlight importer. This is the most visible one. Looking at the code (and its output) it seems that no one has seriously looked at this.

The issue is that when the importer sets the kMDItemDisplayName field, it calls objectValue on an NSXMLNode object (GetMetadataForFile.m line 170), which for attribute nodes gives a string of the form

attributename="attributevalue"

when instead it should be calling stringValue, which would return just attributevalue (the intended behaviour).

There's a similar issue at line 131 which results in the kMDItemAuthors field never being set (it passes an array of NSXMLNode rather than an array of NSString). Also, the kMDItemDurationSeconds field is always set to 0 because it erroneously uses the same value for endDate as startDate when calculating the duration.

In the header of the file, it notes the field kMDItemInstantMessageAddresses. It would make sense to set a value for that -- it would be the same value that it's currently trying (and failing) to set for kMDItemAuthors.

I've never done anything with Adium code before but I'm going to take a shot at making these fixes.

11/05/2007 03:54:47 PM changed by Westacular

A slight correction to my previous comment: The issue with kMDItemDisplayName is not in the use of objectValue; it's actually the result of the problem with kMDItemAuthors and the authorsArray.

11/05/2007 04:19:58 PM changed by evands

We'll be happy to review a patch fixing this up -- thanks for looking into it :)

11/05/2007 08:42:06 PM changed by Westacular

  • attachment spotlight_importer_fixes.diff added.

Several fixes to Adium's indexing of .chatlog files

11/05/2007 09:00:25 PM changed by Westacular

Changes in the patch:

* Fixed output to kMDItemAuthors field.
* Fixed the formatting of output to kMDDisplayName
* Fixed the calculation of kMDDurationSeconds
* Added output of "Adium" to kMDItemCreator
* Added output to kMDItemInstantMessageAddresses (same value as Authors)
* Removed kMDDisplayName entries from schema.xml (Apple says the file should only contain custom fields not defined elsewhere)

* Added com_adiumX_chatDestinations to schema.xml for xmllog format as a multivalued equivalent of com_adiumX_chatDestination for the htmllog format, which was never set for xmllogs. Added the appropriate entries to the .strings files.

* Added output to com_adiumX_chatDestinations (same value as Authors, minus the user's account)

* In Adium's main Info.plist file, under the file association for the xmllog format, changed the value of CFBundleTypeRole from None to Editor. (Since Adium can both save and read the format.) This makes it consistent with the respective value in Adium's htmllog entry, and with iChat's value for its log file format.

11/05/2007 11:01:28 PM changed by zacw

  • patch_status changed from None to Needs Dev Review.
  • milestone changed from Adium X 1.2 to Adium X 1.1.5.

11/05/2007 11:47:49 PM changed by sanmarcos

Thank you very much Westacular for coding a patch! I really hope this gets included in 1.1.5. :D

11/07/2007 07:52:49 PM changed by evands

  • status changed from new to closed.
  • resolution set to fixed.

(In [21569]) Patch from Wesley "Westacular" Campaigne, who writes:

  • Fixed output to kMDItemAuthors field.
  • Fixed the formatting of output to kMDDisplayName
  • Fixed the calculation of kMDDurationSeconds
  • Added output of "Adium" to kMDItemCreator
  • Added output to kMDItemInstantMessageAddresses (same value as Authors)


* Removed kMDDisplayName entries from schema.xml (Apple says the file should only contain custom fields not defined elsewhere)

  • Added com_adiumX_chatDestinations to schema.xml for xmllog format as a multivalued equivalent of com_adiumX_chatDestination for the htmllog format, which was never set for xmllogs. Added the appropriate entries to the .strings files.
  • Added output to com_adiumX_chatDestinations (same value as Authors, minus the user's account)
  • In Adium's main Info.plist file, under the file association for the xmllog format, changed the value of CFBundleTypeRole from None to Editor. (Since Adium can both save and read the format.) This makes it consistent with the respective value in Adium's htmllog entry, and with iChat's value for its log file format.

Fixes #8160

11/07/2007 07:54:02 PM changed by evands

(In [21571]) Merged [21569]: Patch from Wesley "Westacular" Campaigne, who writes:

  • Fixed output to kMDItemAuthors field.
  • Fixed the formatting of output to kMDDisplayName
  • Fixed the calculation of kMDDurationSeconds
  • Added output of "Adium" to kMDItemCreator
  • Added output to kMDItemInstantMessageAddresses (same value as Authors)


* Removed kMDDisplayName entries from schema.xml (Apple says the file should only contain custom fields not defined elsewhere)

  • Added com_adiumX_chatDestinations to schema.xml for xmllog format as a multivalued equivalent of com_adiumX_chatDestination for the htmllog format, which was never set for xmllogs. Added the appropriate entries to the .strings files.
  • Added output to com_adiumX_chatDestinations (same value as Authors, minus the user's account)
  • In Adium's main Info.plist file, under the file association for the xmllog format, changed the value of CFBundleTypeRole from None to Editor. (Since Adium can both save and read the format.) This makes it consistent with the respective value in Adium's htmllog entry, and with iChat's value for its log file format.

Fixes #8160

12/08/2007 09:45:09 AM changed by evands

  • milestone changed from Adium X 1.1.5 to Adium X 1.2.

(follow-up: ↓ 18 ) 02/19/2008 11:50:19 AM changed by sanmarcos

Was this patch ever applied? I am still getting the issue with 1.2.2. Now they don't even show up sometimes.

(in reply to: ↑ 17 ) 02/19/2008 01:51:06 PM changed by Westacular

The fix was present in 1.2 and all versions since. You may need to tell Spotlight to re-index old logs using the new plugin. To do that, run the following in a terminal:

mdimport -r /Applications/Adium.app/Contents/Library/Spotlight/AdiumSpotlightImporter.mdimporter

02/19/2008 04:06:52 PM changed by sanmarcos

That did nothing, none of my logs appear in Spotlight (regardless of the display issue). Do I have to restart or kill a process? or restart spotlight?. Is there a flaw-proof way to see if it indexed them, rather than searching?

(follow-up: ↓ 21 ) 02/20/2008 10:24:45 PM changed by evands

Spotlight in 10.5 doesn't display items in ~/Library... which is where Adium's logs currently are.

(in reply to: ↑ 20 ; follow-up: ↓ 22 ) 02/20/2008 10:26:33 PM changed by sanmarcos

Replying to evands:

Spotlight in 10.5 doesn't display items in ~/Library... which is where Adium's logs currently are.

Are there any plans to fix it? Maybe doing like iChat does by putting it in ~/Documents/?

(in reply to: ↑ 21 ) 02/21/2008 03:04:38 PM changed by Westacular

Spotlight still indexes ~/Library/ files, but the default cmd+space search interface filters out those results,

Doing a search from the cmd+opt+space Spotlight window is one way to avoid that filtering.

More info: http://www.tuaw.com/2007/11/13/spotlight-in-10-5-skips-over-user-library-files/

07/12/2008 07:08:29 AM changed by Robby

  • patch_status changed from Needs Dev Review to Accepted.