[Pidgin] #4526: Jabber /join-command

Pidgin trac at pidgin.im
Sun Dec 30 17:22:50 EST 2007


#4526: Jabber /join-command
------------------------+---------------------------------------------------
Reporter:  Solarius     |       Owner:  lschiere    
    Type:  enhancement  |      Status:  new         
Priority:  minor        |   Component:  unclassified
 Version:  2.3.1        |    Keywords:              
 Pending:  0            |  
------------------------+---------------------------------------------------
 Hi!
 This "patch" will modify the /join command in jabber chat room following
 way:
 Normaly, when user types "/join aroom", user will join to room "aroom" in
 current server (as usual), but if user writes /join
 aroom at conference.jabber.org user will join room "aroom" at server
 "conference.jabber.org"

 Here is the patch for libpurple/protocols/jabber/jabber.c:

 {{{
 2137,2139d2136
 <       size_t str_find;
 <       int str_len;
 <       char roomname[255], servername[255];
 2146,2162c2143,2144
 <
 <       str_find = strcspn (args[0], "@");
 <       str_len = strlen (args[0]);
 <       memset (roomname, 0x00, 255);
 <       memset (servername, 0x00, 255);
 <
 <       if (str_find!=str_len && str_find < 255 && (str_len-str_find) <
 255) {
 <               strncpy (roomname,args[0], str_find);
 <               strncpy (servername,args[0]+(str_find+1), str_len-
 str_find);
 <
 <               g_hash_table_replace(components, "room", roomname);
 <               g_hash_table_replace(components, "server", servername);
 <       } else {
 <               g_hash_table_replace(components, "room", args[0]);
 <               g_hash_table_replace(components, "server", chat->server);
 <       }
 <
 ---
 >       g_hash_table_replace(components, "room", args[0]);
 >       g_hash_table_replace(components, "server", chat->server);

 }}}



 I've also attached the modified file also, just in case.

 And yep, the patch was against 2.3.1 tree ;)

-- 
Ticket URL: <http://developer.pidgin.im/ticket/4526>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list