/* * * find_alloc_ginfo - trys to find a ginfo in the fair share tree. If it * can not find the ginfo, then allocate a new one and * add it to the "unknown" group * * name - name of the ginfo to find * * returns the found ginfo or the newly allocated ginfo * */ group_info *find_alloc_ginfo(char *name) { group_info *ginfo; /* the found group or allocated group */ ginfo = find_group_info(name, conf.group_root); if (ginfo == NULL) { if ((ginfo = new_group_info()) == NULL) return NULL; ginfo-> name = string_dup(name); ginfo -> shares = 1; add_unknown(ginfo); } return ginfo; }
static void eb_icq_user_info(toc_conn *conn, char *user, char *message) { eb_local_account *ela = icq_find_local_account_by_conn(conn); eb_account *sender = NULL; eb_local_account *receiver = NULL; sender = find_account_with_ela(user, ela); if (sender == NULL) { eb_account *ea = g_new0(eb_account, 1); struct eb_icq_account_data *aad = g_new0(struct eb_icq_account_data, 1); strncpy(ea->handle, user, 255); ea->service_id = ela->service_id; aad->status = ICQ_OFFLINE; ea->protocol_account_data = aad; ea->ela = ela; add_unknown(ea); sender = ea; }