comparison mcabber/src/commands.c @ 608:89f5672eb523

/move: really strip trailing space, and assign to no group if no group is specified
author Mikael Berthe <mikael@lilotux.net>
date Thu, 15 Dec 2005 18:42:38 +0100
parents 2e8342168ebc
children d3a8b43bf9e7
comparison
equal deleted inserted replaced
607:cf722bff6579 608:89f5672eb523
1017 } 1017 }
1018 1018
1019 newgroupname = g_strdup(arg); 1019 newgroupname = g_strdup(arg);
1020 // Remove trailing space 1020 // Remove trailing space
1021 for (p = newgroupname; *p; p++) ; 1021 for (p = newgroupname; *p; p++) ;
1022 while (p > newgroupname && *p == ' ') *p = 0; 1022 while (p > newgroupname && *p == ' ') *p-- = 0;
1023 1023
1024 strip_arg_special_chars(newgroupname); 1024 strip_arg_special_chars(newgroupname);
1025 1025
1026 // Call to buddy_setgroup() should be at the end, as current implementation 1026 // Call to buddy_setgroup() should be at the end, as current implementation
1027 // clones the buddy and deletes the old one (and thus, jid and name are 1027 // clones the buddy and deletes the old one (and thus, jid and name are
1028 // freed) 1028 // freed)
1029 jb_updatebuddy(jid, name, newgroupname); 1029 jb_updatebuddy(jid, name, *newgroupname ? newgroupname : NULL);
1030 scr_RosterUp(); 1030 scr_RosterUp();
1031 buddy_setgroup(bud, newgroupname); 1031 buddy_setgroup(bud, newgroupname);
1032 1032
1033 g_free(newgroupname); 1033 g_free(newgroupname);
1034 update_roster = TRUE; 1034 update_roster = TRUE;