aMSN Forums
November 01, 2020, 12:08:54 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [Solved] Notify: no alert if contact nickname begins by dash  (Read 11727 times)
nico@nc
Newbie

Offline Offline

Posts: 11



View Profile WWW
« on: October 06, 2008, 08:20:10 pm »

Hi,

I noticed another problem with the notify plugin: if there is a space followed by a dash (-) in the name of the contact logging in/out, the notification window does not appear.

Quote
[21:15:28] executing notify-send exec notify-send --urgency=normal --expire-time=3000 --icon= --category=im.received {aMSN :} {- name vient de se connecter}
[21:15:28] Error lauching notify-send : Unknown option - name vient de se connecter

It seems that the contact name dash is considered as an option dash by notify-send. This should probably be solved by putting the message between quotation marks (for instance notify-send --option=value --option2=value2 "message" instead of notify-send --option=value --option2=value2 message).
Logged

Nicolas | Mozillian | Ubuntero
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9425


View Profile WWW
« Reply #1 on: October 06, 2008, 11:24:10 pm »

nico, I don't think a quote would help.. you can try yourself if you want.. there's already a quote, otherwise it would say 'invalid number of arguments"... The solution is as simple as :
instead of :
Code:
notify-send --urgency=normal --expire-time=3000 --icon= --category=im.received "aMSN :" "- name vient de se connecter"

Code:
notify-send --urgency=normal --expire-time=3000 --icon= --category=im.received -- "aMSN :" "- name vient de se connecter"
Logged

KaKaRoTo
nico@nc
Newbie

Offline Offline

Posts: 11



View Profile WWW
« Reply #2 on: October 18, 2008, 08:15:02 pm »

Great! Thanks again for your help, kakaroto!  Smiley

Here is what I changed in the plugin file (from the 2008-05-10 version):
  • Replace line 102:
    Code:
    proc exec_notify { txt {email ""} {urgency "normal"} {expire -1} {category "im.received"} {hint ""} } {

    by
    Code:
    proc exec_notify { txt {email ""} {urgency "normal"} {expire -1} {category "im.received"} {dashhack ""} {hint ""} } {]

  • Replace line 223:
    Code:
           set cmd [concat [list "exec" $notify $urgency $expire $icon $category "$title" "$txt"  ]]      

    by
    Code:
           set cmd [concat [list "exec" $notify $urgency $expire $icon $category $dashhack "$title" "$txt"  ]]      

  • Add after line 119 (set expire...):
    Code:
    set hack "--"
This could probably be done in a much more clean way, but it works like this. Smiley

Here is the modified file: http://dl.free.fr/lFzcxraxC.
Logged

Nicolas | Mozillian | Ubuntero
Yoda-BZH
Newbie

Offline Offline

Posts: 6


View Profile
« Reply #3 on: October 18, 2008, 10:55:25 pm »

Hmmm

Why not just doing
Code:
           set cmd [concat [list "exec" $notify $urgency $expire $icon $category "--" "$title" "$txt"  ]]      


Dashhack should always by "--", so why using a new parametre ?
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9425


View Profile WWW
« Reply #4 on: October 19, 2008, 04:38:40 am »

hehe, yeah, I agree with Yoda, the "--" should always be there, and it's not a "hack", it's a valid option that simply says "no more options, treat everything after this argument as being part of the text, even if it starts with a dash"... no need to read the notify-send man page, it's a standard option in many programs, so no need for a hack, just simply do it like Yoda-BZH said.
btw, Yoda, would you mind updating your plugin with plugininfo.xml version and the autoupdate info ? thx
Logged

KaKaRoTo
Yoda-BZH
Newbie

Offline Offline

Posts: 6


View Profile
« Reply #5 on: October 20, 2008, 07:35:10 am »

http://blog.yoda-bzh.net/index.php?post/2008/10/19/Notify-plugin-for-aMSN-updated-13
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!