Adium

Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#8160 closed defect (fixed)

Spotlight display issue for chat logs

Reported by: sanmarcos Owned by: nobody
Milestone: Adium 1.2 Component: Logging
Version: Severity: normal
Keywords: spotlight search logs Cc:
Patch Status: Accepted

Description (last modified by David Smith)

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 (1)

spotlight_importer_fixes.diff (16.3 KB) - added by Wes Campaigne 13 years ago.
Several fixes to Adium's indexing of .chatlog files

Download all attachments as: .zip

Change History (24)

comment:2 Changed 13 years ago by David Smith

Description: modified (diff)
Milestone: Adium X 1.2

comment:3 Changed 13 years ago by Peter Hosey

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.

comment:4 Changed 13 years ago by Peter Hosey

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.

comment:5 in reply to:  3 Changed 13 years ago 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).

comment:6 Changed 13 years ago by Marc

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.

comment:7 Changed 13 years ago by Zachary West

Summary: Spotlight searching doesnt workSpotlight display issue for chat logs

comment:8 Changed 13 years ago by Wes Campaigne

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.

comment:9 Changed 13 years ago by Wes Campaigne

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.

comment:10 Changed 13 years ago by Evan Schoenberg

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

Changed 13 years ago by Wes Campaigne

Several fixes to Adium's indexing of .chatlog files

comment:11 Changed 13 years ago by Wes Campaigne

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.

comment:12 Changed 13 years ago by Zachary West

Milestone: Adium X 1.2Adium X 1.1.5
Patch Status: NoneNeeds Dev Review

comment:13 Changed 13 years ago by Marc

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

comment:14 Changed 13 years ago by Evan Schoenberg

Resolution: fixed
Status: newclosed

(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

comment:15 Changed 13 years ago by Evan Schoenberg

(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

comment:16 Changed 13 years ago by Evan Schoenberg

Milestone: Adium X 1.1.5Adium X 1.2

comment:17 Changed 13 years ago by Marc

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

comment:18 in reply to:  17 Changed 13 years ago by Wes Campaigne

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

comment:19 Changed 13 years ago by Marc

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?

comment:20 Changed 13 years ago by Evan Schoenberg

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

comment:21 in reply to:  20 ; Changed 13 years ago by Marc

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/?

comment:22 in reply to:  21 Changed 13 years ago by Wes Campaigne

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/

comment:23 Changed 12 years ago by Robert

Patch Status: Needs Dev ReviewAccepted
Note: See TracTickets for help on using tickets.