Adium

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#6102 closed defect (fixed)

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

Reported by: wolever Owned by: nobody
Milestone: Adium 1.2.1 Component: None
Version: Severity: minor
Keywords: starter Cc:
Patch Status:

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

ticket6102.diff (1.0 KB) - added by Evan Dickinson 13 years ago.
The patch

Download all attachments as: .zip

Change History (14)

comment:1 Changed 13 years ago by Colin Barrett

Keywords: starter added

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.

Changed 13 years ago by Evan Dickinson

Attachment: ticket6102.diff added

The patch

comment:2 Changed 13 years ago by Evan Dickinson

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.

comment:3 Changed 13 years ago by Colin Barrett

Milestone: Needs dev review

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

comment:4 Changed 12 years ago by Jordan

Milestone: Needs dev reviewAdium X 1.2.2
Patch Status: Needs Dev Review
pending: 0

comment:5 Changed 12 years ago by Evan Schoenberg

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.

comment:6 Changed 12 years ago by Evan Schoenberg

Resolution: fixed
Status: newclosed

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

comment:7 Changed 12 years ago by Evan Schoenberg

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

comment:8 Changed 12 years ago by Evan Schoenberg

Milestone: Adium X 1.2.2Adium X 1.2.1

comment:9 Changed 12 years ago by Evan Schoenberg

Milestone: Adium X 1.2.1Adium X 1.2.3

comment:10 Changed 12 years ago by Evan Schoenberg

Milestone: Adium X 1.2.3Adium X 1.2.1

Not sure what happened there.

comment:11 Changed 12 years ago by Evan Schoenberg

Milestone: Adium X 1.2.1Adium X 1.2.2

comment:12 Changed 12 years ago by Evan Schoenberg

Milestone: Adium X 1.2.2Adium X 1.2.1

comment:13 Changed 12 years ago by Robert

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