Mercurial > pidgin
comparison src/protocols/simple/simple.c @ 12755:505bc707b641
[gaim-migrate @ 15102]
[ 1385161 ] Adding a SIP/SIMPLE buddy without sip: shouldn't abort
Now automatically adding sip:
committer: Tailor Script <tailor@pidgin.im>
| author | Thomas Butter <tbutter> |
|---|---|
| date | Sat, 07 Jan 2006 20:06:58 +0000 |
| parents | d37adb7af391 |
| children | c5acba513363 |
comparison
equal
deleted
inserted
replaced
| 12754:d37adb7af391 | 12755:505bc707b641 |
|---|---|
| 197 static void simple_add_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) | 197 static void simple_add_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) |
| 198 { | 198 { |
| 199 struct simple_account_data *sip = (struct simple_account_data *)gc->proto_data; | 199 struct simple_account_data *sip = (struct simple_account_data *)gc->proto_data; |
| 200 struct simple_buddy *b; | 200 struct simple_buddy *b; |
| 201 if(strncmp("sip:", buddy->name,4)) { | 201 if(strncmp("sip:", buddy->name,4)) { |
| 202 gchar *buf = g_strdup_printf(_("Could not add the buddy %s because every simple user has to start with 'sip:'."), buddy->name); | 202 gchar *buf = g_strdup_printf("sip:%s",buddy->name); |
| 203 gaim_notify_error(gc, NULL, _("Unable To Add"), buf); | 203 gaim_blist_rename_buddy(buddy, buf); |
| 204 g_free(buf); | 204 g_free(buf); |
| 205 gaim_blist_remove_buddy(buddy); | |
| 206 return; | |
| 207 } | 205 } |
| 208 if(!g_hash_table_lookup(sip->buddies, buddy->name)) { | 206 if(!g_hash_table_lookup(sip->buddies, buddy->name)) { |
| 209 b = g_new0(struct simple_buddy, 1); | 207 b = g_new0(struct simple_buddy, 1); |
| 210 gaim_debug_info("simple","simple_add_buddy %s\n",buddy->name); | 208 gaim_debug_info("simple","simple_add_buddy %s\n",buddy->name); |
| 211 b->name = g_strdup(buddy->name); | 209 b->name = g_strdup(buddy->name); |
