# HG changeset patch # User Mikael Berthe # Date 1194733424 -3600 # Node ID 7794d76ca90ed925387eba597a48bdd48f73ef65 # Parent 9716cf8a07269ded9274adcb4055d7006d37295f Warn if the user renames a local item (If a local item is renamed, it is implicitly created on the server.) diff -r 9716cf8a0726 -r 7794d76ca90e mcabber/src/commands.c --- a/mcabber/src/commands.c Sat Nov 10 23:15:16 2007 +0100 +++ b/mcabber/src/commands.c Sat Nov 10 23:23:44 2007 +0100 @@ -290,8 +290,8 @@ // expandalias(line) // If there is one, expand the alias in line and returns a new allocated line // If no alias is found, returns line -// Note : if the returned pointer is different from line, the caller should -// g_free() the pointer after use +// Note: if the returned pointer is different from line, the caller should +// g_free() the pointer after use char *expandalias(const char *line) { const char *p1, *p2; @@ -1707,7 +1707,7 @@ { gpointer bud; const char *bjid, *group; - guint type; + guint type, on_srv; char *newname, *p; char *name_utf8; @@ -1715,9 +1715,10 @@ return; bud = BUDDATA(current_buddy); - bjid = buddy_getjid(bud); - group = buddy_getgroupname(bud); - type = buddy_gettype(bud); + bjid = buddy_getjid(bud); + group = buddy_getgroupname(bud); + type = buddy_gettype(bud); + on_srv = buddy_getonserverflag(bud); if (type & ROSTER_TYPE_SPECIAL) { scr_LogPrint(LPRINT_NORMAL, "You can't rename this item."); @@ -1729,6 +1730,13 @@ return; } + if (!(type & ROSTER_TYPE_GROUP) && !on_srv) { + scr_LogPrint(LPRINT_NORMAL, + "Note: this item will be added to your server roster."); + // TODO + // If this is a MUC room, we may want to update the bookmark instead... + } + newname = g_strdup(arg); // Remove trailing space for (p = newname; *p; p++) ;