GNTP Image URI in Growl 1.3 #8

Open
geetarista opened this Issue Apr 6, 2012 · 3 comments

Comments

Projects
None yet
2 participants

I'm confused as to why GNTP says the following:

The +icon+ map be an image (anything NSImage supports) or a URI (which is unsupported in growl 1.3).

because it seems to be supported in the documentation: http://growl.info/documentation/developer/gntp.php.

I've been trying to figure out how to get this to work, but as far as I can tell, the comparison URI === icon never works.

Am I missing something or does the code need to be changed?

Owner

drbrain commented Apr 6, 2012

When I was discussing this with the growl developers on IRC they said that URL icons had been disabled in the source for growl 1.3. You'll need to wait until the growl developers re-enable images sourced from URLs for them to work. I didn't ask why they were disabled.

If you run in ruby debug mode you'll see that the icon URL is sent:

$ ruby -dIlib -rruby-growl -e 'g = Growl::GNTP.new "localhost", "test"; g.add_notification "test", nil, URI("https://secure.gravatar.com/avatar/58479f76374a3ba3c69b9804163f39f4"); g.register; g.notify "test", "test"'Exception [snipped warnings and caught exceptions]
< GNTP/1.0 REGISTER NONE
< Application-Name: test
< Origin-Software-Name: ruby-growl
< Origin-Software-Version: 4.0
< Origin-Platform-Name: ruby
< Origin-Platform-Version: 2.0.0
< Connection: close
< Notifications-Count: 1
< 
< Notification-Name: test
< Notification-Enabled: true
< Notification-Icon: https://secure.gravatar.com/avatar/58479f76374a3ba3c69b9804163f39f4
< 
< 
< 
> GNTP/1.0 -OK NONE
> Response-Action: REGISTER
> 
> 
> 
< GNTP/1.0 NOTIFY NONE
< Application-Name: test
< Origin-Software-Name: ruby-growl
< Origin-Software-Version: 4.0
< Origin-Platform-Name: ruby
< Origin-Platform-Version: 2.0.0
< Connection: close
< Notification-ID: 2e565410-61c2-012f-bb86-109add49be28
< Notification-Name: test
< Notification-Title: test
< Notification-Icon: https://secure.gravatar.com/avatar/58479f76374a3ba3c69b9804163f39f4
< 
< 
< 
> GNTP/1.0 -OK NONE
> Response-Action: NOTIFY
> Notification-ID: 2e565410-61c2-012f-bb86-109add49be28
> 
> 
> 

Weird that they'd do that. So what's the best way to pass in a file then? I see you passing in straight data, but how can I pass in a local file? I tried several different ways but couldn't get anything to work. I'm trying to get an implementation going to have ruby-growl as a notifier for guard.

Appreciate your help, Eric.

Owner

drbrain commented Apr 13, 2012

Adding code to ruby-growl to fetch images from URLs and send the raw image data would be a nice workaround. I'll see what I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment