comparison src/protocols/oscar/oscar.c @ 5402:f3cf3bff72f0

[gaim-migrate @ 5778] Updated oscar's "could not add buddy for an unknown reason" message to suggest that the reason is because you have too many buddies. Removed a few unneeded memory allocations in irc.c. They were unneeded, right? Fixed up napster chat stuff. It's much simpler now. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 16 May 2003 22:33:13 +0000
parents 5d0df915ca09
children 2c4188300aba
comparison
equal deleted inserted replaced
5401:e03f07e1f7f4 5402:f3cf3bff72f0
4872 if ((tmp = aim_ssi_getpresence(sess->ssi.local)) != 0xFFFFFFFF) 4872 if ((tmp = aim_ssi_getpresence(sess->ssi.local)) != 0xFFFFFFFF)
4873 if (report_idle && !(tmp & 0x400)) 4873 if (report_idle && !(tmp & 0x400))
4874 aim_ssi_setpresence(sess, tmp | 0x400); 4874 aim_ssi_setpresence(sess, tmp | 0x400);
4875 } /* end adding buddies from local list to server list */ 4875 } /* end adding buddies from local list to server list */
4876 4876
4877 { /* Check for maximum number of buddies */
4878 GaimBlistNode *gnode,*bnode;
4879 tmp = 0;
4880 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) {
4881 if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
4882 continue;
4883 for(bnode = gnode->child; bnode; bnode = bnode->next) {
4884 struct buddy *b = (struct buddy *)bnode;
4885 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
4886 continue;
4887 if(b->account == gc->account)
4888 tmp++;
4889 }
4890 }
4891
4892 if (tmp > od->rights.maxbuddies) {
4893 char *dialog_msg = g_strdup_printf(_("The maximum number of buddies allowed in your buddy list is %d, and you have %d."
4894 " Until you are below the limit, some buddies will not show up as online."),
4895 od->rights.maxbuddies, tmp);
4896 do_error_dialog(_("Maximum buddy list length exceeded."), dialog_msg, GAIM_WARNING);
4897 g_free(dialog_msg);
4898 }
4899 }
4900
4901 /* Set our ICQ status */ 4877 /* Set our ICQ status */
4902 if (od->icq && !gc->away) { 4878 if (od->icq && !gc->away) {
4903 aim_setextstatus(sess, AIM_ICQ_STATE_NORMAL); 4879 aim_setextstatus(sess, AIM_ICQ_STATE_NORMAL);
4904 } 4880 }
4905 4881
4943 gaim_auth_sendrequest(gc, retval->name); 4919 gaim_auth_sendrequest(gc, retval->name);
4944 } break; 4920 } break;
4945 4921
4946 default: { /* La la la */ 4922 default: { /* La la la */
4947 gchar *buf; 4923 gchar *buf;
4948 gaim_debug(GAIM_DEBUG_ERROR, "oscar", 4924 gaim_debug(GAIM_DEBUG_ERROR, "oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack);
4949 "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack); 4925 buf = g_strdup_printf(_("Could not add the buddy %s for an unknown reason. The most common reason for this is that you have the maximum number of allowed buddies in your buddy list."), (retval->name ? retval->name : _("(no name)")));
4950 buf = g_strdup_printf(_("Could not add the buddy %s for an unknown reason."), (retval->name ? retval->name : _("(no name)")));
4951 do_error_dialog(_("Unable To Add"), buf, GAIM_ERROR); 4926 do_error_dialog(_("Unable To Add"), buf, GAIM_ERROR);
4952 g_free(buf); 4927 g_free(buf);
4953 /* Should remove buddy from local list? */ 4928 /* XXX - Should remove buddy from local list */
4954 } break; 4929 } break;
4955 } 4930 }
4956 4931
4957 retval = retval->next; 4932 retval = retval->next;
4958 } 4933 }