Adium

Ticket #6102 (closed defect: fixed)

Opened 1 year ago

Last modified 4 months ago

Periods in user name cause user icons to "dissapear" when dragged to Finder

Reported by: wolever Assigned to: nobody
Priority: lowest Milestone: Adium X 1.2.1
Component: None Version:
Severity: minor Keywords: starter
Cc: Patch: Needs Dev Review
Pending: 0

Description

If a user's name is prefixed with a period, dragging their user icon from the info dialog to Finder (to save the user icon) causes it to "disappear" (because Finder thinks that it is a unix config file). To re-create:

  1. Have a buddy with a user icon put a period before their screen name (for instance ".someone")
  2. Open up the Contact Info dialog for that contact (apple+shift+i)
  3. Click and drag their user icon to the Desktop

The icon is saved properly, Finder just does not show it (but ls -alh will).

Attachments

ticket6102.diff (1.0 kB) - added by edickins on 01/21/2007 03:10:24 PM.
The patch

Change History

01/04/2007 03:16:58 PM changed by cbarrett

  • keywords set to starter.

In the appropriate place in the code, add:

if ([string hasPrefix@"."]) {
    string = [string substringFromIndex:1];
}

It would be a good adventure for someone to hunt this down and find out where this is happening.

01/21/2007 03:10:24 PM changed by edickins

  • attachment ticket6102.diff added.

The patch

01/21/2007 03:22:06 PM changed by edickins

I changed -safeFilenameString in AIStringAdditions.m to replace a leading dot with a dash. The function already uses a dash to get rid of slashes.

I didn't just delete the dot from the front of the filename, like cbarrett suggested. Then you have to handle cases like a contact name that starts with two or more dots -- then you need a while loop to delete all the dots. And then what if the contact name is all dots? Then you've deleted the entire filename (except for the extension).

Since this is a utility function used in several places, I tried to find out what other behavior would change. I think these are all acceptable changes, but I'll leave that decision to someone who's not a newbie.

DCMessageContextDisplayPlugin.m: Won't be able to find old log files whose name starts with a dot.

AIPreferenceController.m:631: It doesn't look like this will ever start with a dot, but I'm not really sure.

AIPreferenceController.m:497: Same as line 631

AILoggerPlugin.m:269: Won't be able to find old chat logs where the username starts with a dot.

AILoggerPlugin.m:249: Same as line 269

AIEditAccountWindowController.m:371: Similar to the bug we're fixing: if you drag your picture to the desktop, and your name starts with a dot, won't create a hidden file.

AIContactInfoWindowController.m:459: The bug we're fixing

AIAppearancePreferencesPlugin.m:256: Won't create a list layout or color theme with a filename that starts with a dot

AIAbstractLogViewerWindowController.m:1745: Won't be able to find old log files whose user ID starts with a dot.

AIAbstractLogViewerWindowController.m:1740: Same as line 1745

CBGaimAccount.m:2351: No change. The filename we're using is hard-coded to start with "TEMP"

AIHTMLDecoder.m:1741: The image file saved to disk might have its name changed, if the image started with a dot. But it looks like the image is saved as a temporary file, so I don't think there would be a backwards-compatibility issue.

01/29/2007 10:33:12 AM changed by cbarrett

  • milestone set to Needs dev review.

This needs some thinking about since there are these backwards compatability issues. Excellent work though, edickins!

12/26/2007 08:18:03 PM changed by jas8522

  • patch_status set to Needs Dev Review.
  • pending changed.
  • milestone changed from Needs dev review to Adium X 1.2.2.

01/12/2008 10:50:19 AM changed by evands

This patch demonstrates how the Needs Dev Review milestone isn't really being used; it sat on that milestone for almost exactly a year without anyone doing anything on it. I just noticed it because its patch_status was set (a field which didn't exist a year ago).

I think that this is too far-reaching a change to fix a simple issue; specifically, making us unable to read old log files isn't acceptable.

01/12/2008 10:57:07 AM changed by evands

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

(In [22286]) Prevent files created by dragging from AIImageViewWithImagePicker wells from starting with periods (and therefore being hidden). Fixes #6102

01/12/2008 10:57:43 AM changed by evands

(In [22287]) Merged [22286]: Prevent files created by dragging from AIImageViewWithImagePicker wells from starting with periods (and therefore being hidden). Fixes #6102

01/12/2008 10:57:58 AM changed by evands

  • milestone changed from Adium X 1.2.2 to Adium X 1.2.1.

01/12/2008 10:58:18 AM changed by evands

  • milestone changed from Adium X 1.2.1 to Adium X 1.2.3.

01/13/2008 11:15:18 AM changed by evands

  • milestone changed from Adium X 1.2.3 to Adium X 1.2.1.

Not sure what happened there.

01/14/2008 06:01:49 PM changed by evands

  • milestone changed from Adium X 1.2.1 to Adium X 1.2.2.

01/15/2008 09:54:53 PM changed by evands

  • milestone changed from Adium X 1.2.2 to Adium X 1.2.1.