[Pidgin Plugins] #390: Proposed solution: "ignore" plugin fails when using non-lowercase account names.

Pidgin Plugins plugins-trac at guifications.org
Fri Aug 24 13:34:52 CDT 2007


#390: Proposed solution: "ignore" plugin fails when using non-lowercase account
names.
------------------------+---------------------------------------------------
 Reporter:  qwert       |       Type:  Patches        
   Status:  new         |   Priority:  4              
Component:  PluginPack  |    Version:  Current Release
  Pending:  0           |  
------------------------+---------------------------------------------------
 Hello,
 I'm not really experienced with this, so please bear with me :)

 This is about ''purple-plugin_pack-2.1.1''. You should be able to
 replicate the bug by doing the following:
  * Enable the ''ignore'' plugin
  * Log on to IRC '''with a non-lowercase pidgin account name''' (nickname
 or IRC username doesn't seem to matter)
  * Enter "/ignore +someone"
  * Enter "/ignore". This should show the ignore list, but instead crashes
 at line 115, apparently because "rule" is a nullpointer.But I think this
 is not the only problem; the ignore functionality doesn't seem to work
 either.

 I think the reason is the following: Look at the "`add_ignore_rule`"
 function. In line 70 (Note that this is the ''second'' occurence of
 "`purple_prefs_add_none(string->str)`"), a new preferences directory for
 the current account is created if it doesn't already exist. ''At this
 point, "string" is still in non-lowercase''.

 In line 73, the final preferences path is converted to lowercase. This
 apparently makes line 76 not work, since it tries to create a key in a
 directory that doesn't exist.

 At first glance, the bug is fixed by changing line 69 and 70 into:
 {{{
 lower_case_username = g_ascii_strdown(string->str, string->len);
 if (!purple_prefs_exists(lower_case_username))
   purple_prefs_add_none(lower_case_username);
 g_free(lower_case_username);
 }}}
 and of course adding "`char *lower_case_username;`" on top.

 But I hardly know any C, so I will best leave this to you lest I break
 something...

-- 
Ticket URL: <http://plugins.guifications.org/trac/ticket/390>
Pidgin Plugins <http://pidgin.guifications.org/>
Plugins for the Instant Messaging client Pidgin and its backend library libpurple


More information about the Plugins-tickets mailing list