Changeset a0a5179
- Timestamp:
- Nov 19, 2003, 11:19:03 PM (21 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- f1645da
- Parents:
- 52f3507
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rcb78880 ra0a5179 1 1 $Id$ 2 2 3 2.0.13 4 Changed startup message for new mailing list 5 3 6 2.0.12 4 7 Command history now doesn't allow the last entry -
aim.c
r1db061d ra0a5179 116 116 117 117 /* an experiment to expose idle time */ 118 aim_ssi_setpresence(owl_global_get_aimsess(&g), 0x00000400);118 /* aim_ssi_setpresence(owl_global_get_aimsess(&g), 0x00000400); */ 119 119 } 120 120 … … 136 136 aim_tx_setenqueue(owl_global_get_aimsess(&g), AIM_TX_IMMEDIATE, NULL); 137 137 138 /* login */138 /* request a login */ 139 139 ret=login(owl_global_get_aimsess(&g), priv->screenname, priv->password); 140 140 if (ret) { … … 143 143 return(-1); 144 144 } 145 146 /* start processing AIM events */ 145 147 owl_global_set_doaimevents(&g); 146 148 147 149 return(0); 148 150 } 149 150 #if 0151 static void oscar_login(GaimAccount *account)152 {153 aim_session_t *sess;154 aim_conn_t *conn;155 char buf[256];156 GaimConnection *gc = gaim_account_get_connection(account);157 struct oscar_data *od = gc->proto_data = g_new0(struct oscar_data, 1);158 159 gaim_debug(GAIM_DEBUG_MISC, "oscar", "oscar_login: gc = %p\n", gc);160 161 if (isdigit(*(gaim_account_get_username(account)))) {162 od->icq = TRUE;163 } else {164 gc->flags |= GAIM_CONNECTION_HTML;165 gc->flags |= GAIM_CONNECTION_AUTO_RESP;166 }167 od->buddyinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, oscar_free_buddyinfo);168 169 sess = g_new0(aim_session_t, 1);170 171 aim_session_init(sess, AIM_SESS_FLAGS_NONBLOCKCONNECT, 0);172 aim_setdebuggingcb(sess, oscar_debug);173 174 /* we need an immediate queue because we don't use a while-loop to175 * see if things need to be sent. */176 aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL);177 od->sess = sess;178 sess->aux_data = gc;179 180 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, NULL);181 if (conn == NULL) {182 gaim_debug(GAIM_DEBUG_ERROR, "oscar",183 "internal connection error\n");184 gaim_connection_error(gc, _("Unable to login to AIM"));185 return;186 }187 188 g_snprintf(buf, sizeof(buf), _("Signon: %s"), gaim_account_get_username(account));189 gaim_connection_update_progress(gc, buf, 2, 5);190 191 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR, gaim_connerr, 0);192 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0);193 aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0);194 195 conn->status |= AIM_CONN_STATUS_INPROGRESS;196 if (gaim_proxy_connect(account, gaim_account_get_string(account, "server", FAIM_LOGIN_SERVER),197 gaim_account_get_int(account, "port", FAIM_LOGIN_PORT),198 oscar_login_connect, gc) < 0) {199 gaim_connection_error(gc, _("Couldn't connect to host"));200 return;201 }202 aim_request_login(sess, conn, gaim_account_get_username(account));203 }204 #endif205 206 151 207 152 /* stuff to run once login has been successful */ … … 269 214 void owl_aim_addbuddy(char *name) 270 215 { 216 271 217 aim_ssi_addbuddy(owl_global_get_aimsess(&g), name, "Buddies", NULL, NULL, NULL, 0); 218 219 /* 220 aim_ssi_addbuddy(owl_global_get_aimsess(&g), 221 name, 222 "Buddies", 223 NULL, NULL, NULL, 224 aim_ssi_waitingforauth(owl_global_get_aimsess(&g)->ssi.local, "Buddies", name)); 225 */ 272 226 } 273 227 … … 566 520 aim_bos_reqrights(sess, fr->conn); /* XXX - Don't call this with ssi? */ 567 521 568 /* aim_bos_setprofile(owl_global_get_aimsess(&g), fr->conn, NULL, NULL, 0, NULL, NULL, 0, AIM_CAPS_ CHAT); */522 /* aim_bos_setprofile(owl_global_get_aimsess(&g), fr->conn, NULL, NULL, 0, NULL, NULL, 0, AIM_CAPS_EMPTY); */ 569 523 570 524 #ifdef NOSSI … … 588 542 589 543 if (!priv->screenname || !priv->password) { 590 /* printf("need SN and password\n"); */544 owl_function_error("Internal error: aim login called without screenname or password"); 591 545 return(-1); 592 546 } 593 547 594 548 if (!(authconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, priv->server ? priv->server : FAIM_LOGIN_SERVER))) { 595 /* printf("internal connection error during login\n"); */549 owl_function_error("Internal error: connection error during AIM login\n"); 596 550 return (-1); 597 551 } else if (authconn->fd == -1) { 598 552 if (authconn->status & AIM_CONN_STATUS_RESOLVERR) { 599 /* printf("could not resolve authorizer name\n");*/553 owl_function_error("AIM: could not resolve authorize name"); 600 554 } else if (authconn->status & AIM_CONN_STATUS_CONNERR) { 601 /* printf("could not connect to authorizer\n"); */555 owl_function_error("AIM: could not connect to authorizer"); 602 556 } 603 557 aim_conn_kill(sess, &authconn); … … 612 566 /* If the connection is in progress, this will just be queued */ 613 567 aim_request_login(sess, authconn, priv->screenname); 614 615 /* printf("login request sent\n"); */ 568 owl_function_debugmsg("AIM login request sent for %s", priv->screenname); 569 616 570 return(0); 617 571 } … … 621 575 { 622 576 aim_clientready(sess, fr->conn); 623 /* printf("initialization done for admin connection\n"); */577 owl_function_debugmsg("conninitdone_admin: initializtion done for admin connection"); 624 578 return(1); 625 579 } … … 629 583 aim_session_kill(sess); 630 584 owl_aim_init(); 631 632 /* kretch 585 586 owl_function_debugmsg("libfaim logout called"); 587 /* 633 588 if (faimtest_init() == -1) 634 589 printf("faimtest_init failed\n"); … … 770 725 771 726 /* printf("buddy list rights: Max buddies = %d / Max watchers = %d\n", maxbuddies, maxwatchers); */ 727 owl_function_debugmsg("in faimtest_parse_buddyrights"); 772 728 773 729 /* aim_ssi_reqrights(sess, fr->conn); */ … … 802 758 maxsiglen = va_arg(ap, int); 803 759 va_end(ap); 760 761 owl_function_debugmsg("in faimtest_parse_locrights"); 804 762 805 763 /* printf("locate rights: max signature length = %d\n", maxsiglen); */ -
fmtext.c
r252a5c2 ra0a5179 157 157 for (i=0; i<nspaces; i++) { 158 158 owl_fmtext_append_normal(f, " "); 159 }160 }161 162 /* requires that the list values are strings or NULL.163 * joins the elements together with join_with.164 * If format_fn is specified, passes it the list element value165 * and it will return a string which this needs to free. */166 void owl_fmtext_append_list(owl_fmtext *f, owl_list *l, char *join_with, char *(format_fn)(void*))167 {168 int i, size;169 void *elem;170 char *text;171 172 size = owl_list_get_size(l);173 for (i=0; i<size; i++) {174 elem = (char*)owl_list_get_element(l,i);175 if (elem && format_fn) {176 text = format_fn(elem);177 if (text) {178 owl_fmtext_append_normal(f, text);179 owl_free(text);180 }181 } else if (elem) {182 owl_fmtext_append_normal(f, elem);183 }184 if ((i < size-1) && join_with) {185 owl_fmtext_append_normal(f, join_with);186 }187 159 } 188 160 } … … 362 334 } 363 335 336 /* set the charater at 'index' to be 'char'. If index is out of 337 * bounds don't do anything */ 364 338 void owl_fmtext_set_char(owl_fmtext *f, int index, int ch) 365 339 { 366 /* set the charater at 'index' to be 'char'. If index is out of367 * bounds don't do anything */368 340 if ((index < 0) || (index > f->textlen-1)) return; 369 341 f->textbuff[index]=ch; 370 }371 372 /* Free all memory allocated by the object */373 void owl_fmtext_free(owl_fmtext *f)374 {375 if (f->textbuff) owl_free(f->textbuff);376 if (f->fmbuff) owl_free(f->fmbuff);377 if (f->colorbuff) owl_free(f->colorbuff);378 342 } 379 343 … … 623 587 } 624 588 } 589 590 /* requires that the list values are strings or NULL. 591 * joins the elements together with join_with. 592 * If format_fn is specified, passes it the list element value 593 * and it will return a string which this needs to free. */ 594 void owl_fmtext_append_list(owl_fmtext *f, owl_list *l, char *join_with, char *(format_fn)(void*)) 595 { 596 int i, size; 597 void *elem; 598 char *text; 599 600 size = owl_list_get_size(l); 601 for (i=0; i<size; i++) { 602 elem = (char*)owl_list_get_element(l,i); 603 if (elem && format_fn) { 604 text = format_fn(elem); 605 if (text) { 606 owl_fmtext_append_normal(f, text); 607 owl_free(text); 608 } 609 } else if (elem) { 610 owl_fmtext_append_normal(f, elem); 611 } 612 if ((i < size-1) && join_with) { 613 owl_fmtext_append_normal(f, join_with); 614 } 615 } 616 } 617 618 /* Free all memory allocated by the object */ 619 void owl_fmtext_free(owl_fmtext *f) 620 { 621 if (f->textbuff) owl_free(f->textbuff); 622 if (f->fmbuff) owl_free(f->fmbuff); 623 if (f->colorbuff) owl_free(f->colorbuff); 624 } 625 -
functions.c
rcee1f25 ra0a5179 3000 3000 owl_fmtext_init_null(&fm); 3001 3001 3002 /* AIM first */ 3002 3003 if (aim && owl_global_is_aimloggedin(&g)) { 3003 3004 bl=owl_global_get_buddylist(&g); … … 3014 3015 timestr=owl_strdup(""); 3015 3016 } 3016 foo=owl_sprintf(" %-20.20s %-12.12s\n", 3017 owl_buddy_get_name(b), 3018 timestr); 3017 foo=owl_sprintf(" %-20.20s %-12.12s\n", owl_buddy_get_name(b), timestr); 3019 3018 owl_fmtext_append_normal(&fm, foo); 3020 3019 owl_free(timestr); … … 3027 3026 if (file==NULL) { 3028 3027 tmp=owl_global_get_homedir(&g); 3029 if (!tmp) { 3030 owl_function_error("Could not determine home directory"); 3031 return; 3032 } 3033 ourfile=owl_malloc(strlen(tmp)+50); 3034 sprintf(ourfile, "%s/.anyone", owl_global_get_homedir(&g)); 3028 ourfile=owl_sprintf("%s/.anyone", owl_global_get_homedir(&g)); 3035 3029 } else { 3036 3030 ourfile=owl_strdup(file); 3037 3031 } 3038 3032 3033 owl_fmtext_append_bold(&fm, "Zephyr users logged in:\n"); 3039 3034 f=fopen(ourfile, "r"); 3040 3035 if (!f) { 3041 owl_function_error("Error opening file %s: %s", 3042 ourfile, 3043 strerror(errno) ? strerror(errno) : ""); 3044 return; 3045 } 3046 3047 owl_fmtext_append_bold(&fm, "Zephyr users logged in:\n"); 3048 3049 while (fgets(buff, LINE, f)!=NULL) { 3050 /* ignore comments, blank lines etc. */ 3051 if (buff[0]=='#') continue; 3052 if (buff[0]=='\n') continue; 3053 if (buff[0]=='\0') continue; 3054 3055 /* strip the \n */ 3056 buff[strlen(buff)-1]='\0'; 3057 3058 /* ingore from # on */ 3059 tmp=strchr(buff, '#'); 3060 if (tmp) tmp[0]='\0'; 3061 3062 /* ingore from SPC */ 3063 tmp=strchr(buff, ' '); 3064 if (tmp) tmp[0]='\0'; 3065 3066 /* stick on the local realm. */ 3067 if (!strchr(buff, '@')) { 3068 strcat(buff, "@"); 3069 strcat(buff, ZGetRealm()); 3070 } 3071 3072 ret=ZLocateUser(buff, &numlocs, ZAUTH); 3073 if (ret!=ZERR_NONE) { 3074 owl_function_error("Error getting location for %s", buff); 3075 continue; 3076 } 3077 3078 numlocs=200; 3079 ret=ZGetLocations(location, &numlocs); 3080 if (ret==0) { 3081 for (i=0; i<numlocs; i++) { 3082 line=malloc(strlen(location[i].host)+strlen(location[i].time)+strlen(location[i].tty)+100); 3083 tmp=short_zuser(buff); 3084 sprintf(line, " %-10.10s %-24.24s %-12.12s %20.20s\n", 3085 tmp, 3086 location[i].host, 3087 location[i].tty, 3088 location[i].time); 3089 owl_fmtext_append_normal(&fm, line); 3090 owl_free(tmp); 3036 owl_fmtext_append_normal(&fm, " Error opening file "); 3037 owl_fmtext_append_normal(&fm, ourfile); 3038 owl_fmtext_append_normal(&fm, "\n"); 3039 owl_function_error("Error opening file %s: %s", ourfile, strerror(errno) ? strerror(errno) : ""); 3040 } else { 3041 while (fgets(buff, LINE, f)!=NULL) { 3042 /* ignore comments, blank lines etc. */ 3043 if (buff[0]=='#') continue; 3044 if (buff[0]=='\n') continue; 3045 if (buff[0]=='\0') continue; 3046 3047 /* strip the \n */ 3048 buff[strlen(buff)-1]='\0'; 3049 3050 /* ingore from # on */ 3051 tmp=strchr(buff, '#'); 3052 if (tmp) tmp[0]='\0'; 3053 3054 /* ingore from SPC */ 3055 tmp=strchr(buff, ' '); 3056 if (tmp) tmp[0]='\0'; 3057 3058 /* stick on the local realm. */ 3059 if (!strchr(buff, '@')) { 3060 strcat(buff, "@"); 3061 strcat(buff, ZGetRealm()); 3091 3062 } 3092 if (numlocs>=200) { 3093 owl_fmtext_append_normal(&fm, " Too many locations found for this user, truncating.\n"); 3063 3064 ret=ZLocateUser(buff, &numlocs, ZAUTH); 3065 if (ret!=ZERR_NONE) { 3066 owl_function_error("Error getting location for %s", buff); 3067 continue; 3068 } 3069 3070 numlocs=200; 3071 ret=ZGetLocations(location, &numlocs); 3072 if (ret==0) { 3073 for (i=0; i<numlocs; i++) { 3074 line=malloc(strlen(location[i].host)+strlen(location[i].time)+strlen(location[i].tty)+100); 3075 tmp=short_zuser(buff); 3076 sprintf(line, " %-10.10s %-24.24s %-12.12s %20.20s\n", 3077 tmp, 3078 location[i].host, 3079 location[i].tty, 3080 location[i].time); 3081 owl_fmtext_append_normal(&fm, line); 3082 owl_free(tmp); 3083 } 3084 if (numlocs>=200) { 3085 owl_fmtext_append_normal(&fm, " Too many locations found for this user, truncating.\n"); 3086 } 3094 3087 } 3095 3088 } 3096 }3097 fclose(f);3089 fclose(f); 3090 } 3098 3091 owl_free(ourfile); 3099 3092 } -
libfaim/aim_cbtypes.h
re374dee ra0a5179 212 212 #define AIM_CB_SSI_REQDATA 0x0004 213 213 #define AIM_CB_SSI_REQIFCHANGED 0x0005 214 #define AIM_CB_SSI_REQLIST 0x0005 214 215 #define AIM_CB_SSI_LIST 0x0006 215 216 #define AIM_CB_SSI_ACTIVATE 0x0007 -
libfaim/ssi.c
ra053de8 ra0a5179 41 41 int newlen; 42 42 struct aim_ssi_item *cur, *group; 43 44 if (!list) 45 return NULL; 43 44 owl_function_debugmsg("aim_ssi_itemlist_rebuildgroup: in for group %s", name?name:"NULL"); 45 46 if (!list) return(NULL); 46 47 47 48 /* Find the group */ 48 if (!(group = aim_ssi_itemlist_finditem(list, name, NULL, AIM_SSI_TYPE_GROUP))) 49 return NULL; 49 if (!(group = aim_ssi_itemlist_finditem(list, name, NULL, AIM_SSI_TYPE_GROUP))) return(NULL); 50 50 51 51 /* Free the old data */ … … 64 64 newlen += 2; 65 65 } 66 owl_function_debugmsg("aim_ssi_itemlist_rebuildgroup: newlen is %i", newlen); 66 67 67 68 /* Build the new TLV list */ … … 69 70 fu8_t *newdata; 70 71 71 if (!(newdata = (fu8_t *)malloc((newlen)*sizeof(fu8_t)))) 72 return NULL; 72 if (!(newdata = (fu8_t *)malloc((newlen)*sizeof(fu8_t)))) return NULL; 73 73 newlen = 0; 74 74 if (group->gid == 0x0000) { … … 85 85 free(newdata); 86 86 } 87 87 88 owl_function_debugmsg("aim_ssi_itemlist_rebuildgroup: exiting"); 88 89 return group; 89 90 } … … 177 178 if (!list || !(*list) || !del) return -EINVAL; 178 179 180 owl_function_debugmsg("aim_ssi_itemlist_del: in"); 179 181 /* Remove the item from the list */ 180 182 if (*list == del) { 181 183 *list = (*list)->next; 184 owl_function_debugmsg("aim_ssi_itemlist_del: deleted %s from beginning of list", del->name); 182 185 } else { 183 186 struct aim_ssi_item *cur; 184 187 for (cur=*list; (cur->next && (cur->next!=del)); cur=cur->next); 185 188 if (cur->next) cur->next=cur->next->next; 189 owl_function_debugmsg("aim_ssi_itemlist_del: deleted %s from middle of list", del->name); 186 190 } 187 191 188 192 /* Free the deleted item */ 193 owl_function_debugmsg("aim_ssi_itemlist_del: freeing"); 189 194 free(del->name); 190 195 aim_freetlvchain(&del->data); … … 450 455 struct aim_ssi_item *cur1, *cur2; 451 456 struct aim_ssi_tmp *cur, *new; 452 453 if (!sess) 454 return -EINVAL; 455 457 458 owl_function_debugmsg("aim_ssi_sync: beginning"); 459 460 if (!sess) return (-EINVAL); 461 456 462 /* If we're waiting for an ack, we shouldn't do anything else */ 457 if (sess->ssi.waiting_for_ack) 463 if (sess->ssi.waiting_for_ack) { 464 owl_function_debugmsg("Aborting aim_ssi_sync, waiting for ack"); 458 465 return 0; 466 } 459 467 460 468 /* … … 466 474 * buddy ID#s, which makes things more efficient. I think. 467 475 */ 468 476 469 477 /* Additions */ 470 478 if (!sess->ssi.pending) { 471 479 for (cur1=sess->ssi.local; cur1; cur1=cur1->next) { 472 480 if (!aim_ssi_itemlist_find(sess->ssi.official, cur1->gid, cur1->bid)) { 481 owl_function_debugmsg("aim_ssi_sync: doing addition"); 473 482 new = (struct aim_ssi_tmp *)malloc(sizeof(struct aim_ssi_tmp)); 474 483 new->action = AIM_CB_SSI_ADD; … … 490 499 for (cur1=sess->ssi.official; cur1; cur1=cur1->next) { 491 500 if (!aim_ssi_itemlist_find(sess->ssi.local, cur1->gid, cur1->bid)) { 501 owl_function_debugmsg("aim_ssi_sync: doing deletion"); 492 502 new = (struct aim_ssi_tmp *)malloc(sizeof(struct aim_ssi_tmp)); 493 503 new->action = AIM_CB_SSI_DEL; … … 510 520 cur2 = aim_ssi_itemlist_find(sess->ssi.official, cur1->gid, cur1->bid); 511 521 if (cur2 && (aim_ssi_itemlist_cmp(cur1, cur2))) { 522 owl_function_debugmsg("aim_ssi_sync: doing modification"); 512 523 new = (struct aim_ssi_tmp *)malloc(sizeof(struct aim_ssi_tmp)); 513 524 new->action = AIM_CB_SSI_MOD; … … 527 538 /* We're out of stuff to do, so tell the AIM servers we're done and exit */ 528 539 if (!sess->ssi.pending) { 540 owl_function_debugmsg("aim_ssi_sync: telling server we're done modifying SSI data."); 529 541 aim_ssi_modend(sess); 530 542 return 0; … … 533 545 /* Make sure we don't send anything else between now 534 546 * and when we receive the ack for the following operation */ 547 owl_function_debugmsg("aim_ssi_sync: setting SSI waiting_for_ack"); 535 548 sess->ssi.waiting_for_ack = 1; 536 549 537 550 /* Now go mail off our data and wait 4 to 6 weeks */ 551 owl_function_debugmsg("aim_ssi_sync: about to call addmoddel to send SNACs to server"); 538 552 aim_ssi_addmoddel(sess); 539 553 … … 789 803 /* Remove the item from the list */ 790 804 aim_ssi_itemlist_del(&sess->ssi.local, del); 791 805 792 806 /* Modify the parent group */ 793 807 aim_ssi_itemlist_rebuildgroup(sess->ssi.local, group); … … 807 821 808 822 /* Sync our local list with the server list */ 823 owl_function_debugmsg("aim_ssi_delbuddy: about to sync"); 809 824 aim_ssi_sync(sess); 810 825 … … 1261 1276 struct aim_ssi_tmp *cur; 1262 1277 1263 if (!sess || !(conn = aim_conn_findbygroup(sess, AIM_CB_FAM_SSI)) || !sess->ssi.pending || !sess->ssi.pending->item) 1278 if (!sess || !(conn = aim_conn_findbygroup(sess, AIM_CB_FAM_SSI)) || !sess->ssi.pending || !sess->ssi.pending->item) { 1279 owl_function_debugmsg("aim_ssi_addmoddel: aborting early"); 1264 1280 return -EINVAL; 1281 } 1265 1282 1266 1283 /* Calculate total SNAC size */ … … 1268 1285 for (cur=sess->ssi.pending; cur; cur=cur->next) { 1269 1286 snaclen += 10; /* For length, GID, BID, type, and length */ 1270 if (cur->item->name) 1271 snaclen += strlen(cur->item->name); 1272 if (cur->item->data) 1273 snaclen += aim_sizetlvchain(&cur->item->data); 1274 } 1275 1276 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, snaclen))) 1277 return -ENOMEM; 1287 if (cur->item->name) snaclen += strlen(cur->item->name); 1288 if (cur->item->data) snaclen += aim_sizetlvchain(&cur->item->data); 1289 } 1290 1291 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, snaclen))) return (-ENOMEM); 1278 1292 1279 1293 snacid = aim_cachesnac(sess, AIM_CB_FAM_SSI, sess->ssi.pending->action, 0x0000, NULL, 0); … … 1282 1296 for (cur=sess->ssi.pending; cur; cur=cur->next) { 1283 1297 aimbs_put16(&fr->data, cur->item->name ? strlen(cur->item->name) : 0); 1284 if (cur->item->name) 1285 aimbs_putraw(&fr->data, cur->item->name, strlen(cur->item->name)); 1298 if (cur->item->name) aimbs_putraw(&fr->data, cur->item->name, strlen(cur->item->name)); 1286 1299 aimbs_put16(&fr->data, cur->item->gid); 1287 1300 aimbs_put16(&fr->data, cur->item->bid); 1288 1301 aimbs_put16(&fr->data, cur->item->type); 1289 1302 aimbs_put16(&fr->data, cur->item->data ? aim_sizetlvchain(&cur->item->data) : 0); 1290 if (cur->item->data) 1291 aim_writetlvchain(&fr->data, &cur->item->data); 1303 if (cur->item->data) aim_writetlvchain(&fr->data, &cur->item->data); 1292 1304 } 1293 1305 1294 1306 aim_tx_enqueue(sess, fr); 1295 1307 1308 owl_function_debugmsg("aim_ssi_addmoddel: exiting normally"); 1296 1309 return 0; 1297 1310 } … … 1441 1454 aim_rxcallback_t userfunc; 1442 1455 struct aim_ssi_tmp *cur, *del; 1456 1457 owl_function_debugmsg("Handling SNAC SSI ACK"); 1443 1458 1444 1459 /* Read in the success/failure flags from the ack SNAC */ … … 1455 1470 */ 1456 1471 for (cur=sess->ssi.pending; (cur && (cur->ack != 0xffff)); cur=cur->next) { 1472 owl_function_debugmsg("parseack: processing a change"); 1457 1473 if (cur->item) { 1458 1474 if (cur->ack) { 1459 1475 /* Our action was unsuccessful, so change the local list back to how it was */ 1460 1476 if (cur->action == AIM_CB_SSI_ADD) { 1477 owl_function_debugmsg("parseack: unsuccesful add, reverting"); 1461 1478 /* Remove the item from the local list */ 1462 1479 /* Make sure cur->item is still valid memory */ … … 1472 1489 } else if (cur->action == AIM_CB_SSI_MOD) { 1473 1490 /* Replace the local item with the item from the official list */ 1491 owl_function_debugmsg("parseack: unsuccesful modify, reverting"); 1474 1492 if (aim_ssi_itemlist_valid(sess->ssi.local, cur->item)) { 1475 1493 struct aim_ssi_item *cur1; … … 1489 1507 } else if (cur->action == AIM_CB_SSI_DEL) { 1490 1508 /* Add the item back into the local list */ 1509 owl_function_debugmsg("parseack: unsuccesful delete, reverting"); 1491 1510 if (aim_ssi_itemlist_valid(sess->ssi.official, cur->item)) { 1492 1511 aim_ssi_itemlist_add(&sess->ssi.local, cur->item->name, cur->item->gid, cur->item->bid, cur->item->type, cur->item->data); … … 1499 1518 if (cur->action == AIM_CB_SSI_ADD) { 1500 1519 /* Add the local item to the official list */ 1520 owl_function_debugmsg("parseack: succesful add"); 1501 1521 if (aim_ssi_itemlist_valid(sess->ssi.local, cur->item)) { 1502 1522 aim_ssi_itemlist_add(&sess->ssi.official, cur->item->name, cur->item->gid, cur->item->bid, cur->item->type, cur->item->data); … … 1506 1526 } else if (cur->action == AIM_CB_SSI_MOD) { 1507 1527 /* Replace the official item with the item from the local list */ 1528 owl_function_debugmsg("parseack: succesful modify"); 1508 1529 if (aim_ssi_itemlist_valid(sess->ssi.local, cur->item)) { 1509 1530 struct aim_ssi_item *cur1; … … 1523 1544 } else if (cur->action == AIM_CB_SSI_DEL) { 1524 1545 /* Remove the item from the official list */ 1546 owl_function_debugmsg("parseack: succesful delete"); 1525 1547 if (aim_ssi_itemlist_valid(sess->ssi.official, cur->item)) 1526 1548 aim_ssi_itemlist_del(&sess->ssi.official, cur->item); … … 1546 1568 1547 1569 /* If we're not waiting for any more acks, then send more SNACs */ 1570 1548 1571 if (!sess->ssi.pending) { 1549 1572 sess->ssi.pending = NULL; 1550 1573 sess->ssi.waiting_for_ack = 0; 1574 owl_function_debugmsg("parseack: Clearing SSI waiting_for_ack"); 1551 1575 aim_ssi_sync(sess); 1552 1576 } 1577 1578 owl_function_debugmsg("parseack: returning with %i", ret); 1553 1579 1554 1580 return ret; … … 1601 1627 aim_conn_t *conn; 1602 1628 1603 if (!sess || !(conn = aim_conn_findbygroup(sess, AIM_CB_FAM_SSI))) 1604 return -EINVAL; 1629 if (!sess || !(conn = aim_conn_findbygroup(sess, AIM_CB_FAM_SSI))) return -EINVAL; 1605 1630 1606 1631 return aim_genericreq_n(sess, conn, AIM_CB_FAM_SSI, AIM_CB_SSI_EDITSTOP); -
owl.c
r52f3507 ra0a5179 57 57 #endif 58 58 59 owl_function_debugmsg("startup: it's the very best place to start"); 60 61 owl_function_debugmsg("startup: processing command line arguments"); 59 62 argcsave=argc; 60 63 argvsave=argv; … … 106 109 #ifdef HAVE_LIBZEPHYR 107 110 /* zephyr init */ 111 owl_function_debugmsg("startup: initializing zephyr"); 108 112 ret=owl_zephyr_initialize(); 109 113 if (ret) { … … 113 117 114 118 /* signal handler */ 119 owl_function_debugmsg("startup: setting up signal handler"); 115 120 sigact.sa_handler=sig_handler; 116 121 sigemptyset(&sigact.sa_mask); … … 120 125 121 126 /* screen init */ 127 owl_function_debugmsg("startup: initializing screen"); 122 128 sprintf(buff, "TERMINFO=%s", TERMINFO); 123 129 putenv(buff); … … 143 149 144 150 /* owl global init */ 151 owl_function_debugmsg("startup: doing owl global initialization"); 145 152 owl_global_init(&g); 146 153 if (debug) owl_global_set_debug_on(&g); … … 152 159 153 160 #if OWL_STDERR_REDIR 154 /* Do this only after we've started curses up... */ 161 /* Do this only after we've started curses up... */ 162 owl_function_debugmsg("startup: doing stderr redirection"); 155 163 newstderr = stderr_replace(); 156 164 #endif 157 165 158 166 /* create the owl directory, in case it does not exist */ 167 owl_function_debugmsg("startup: creating owl directory, if not present"); 159 168 dir=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_CONFIG_DIR); 160 169 mkdir(dir, S_IRWXU); … … 162 171 163 172 /* set the tty, either from the command line, or by figuring it out */ 173 owl_function_debugmsg("startup: setting tty name"); 164 174 if (tty) { 165 175 owl_global_set_tty(&g, tty); … … 169 179 170 180 /* setup the built-in styles */ 181 owl_function_debugmsg("startup: creating built-in styles"); 171 182 s=owl_malloc(sizeof(owl_style)); 172 183 owl_style_create_internal(s, "default", &owl_stylefunc_default, … … 192 203 /* the personal filter will need to change again when AIM chat's are 193 204 * included. Also, there should be an %aimme% */ 205 owl_function_debugmsg("startup: creating default filters"); 194 206 f=owl_malloc(sizeof(owl_filter)); 195 207 owl_filter_init_fromstring(f, "personal", "( type ^zephyr$ " … … 240 252 241 253 /* set the current view */ 254 owl_function_debugmsg("startup: setting the current view"); 242 255 owl_view_create(owl_global_get_current_view(&g), "main", f, owl_global_get_style_by_name(&g, "default")); 243 256 244 257 /* AIM init */ 258 owl_function_debugmsg("startup: doing AIM initialization"); 245 259 owl_aim_init(); 246 260 247 261 /* process the startup file */ 262 owl_function_debugmsg("startup: processing startup file"); 248 263 owl_function_source(NULL); 249 264 250 265 /* read the config file */ 266 owl_function_debugmsg("startup: processing config file"); 251 267 owl_context_set_readconfig(owl_global_get_context(&g)); 252 268 perlerr=owl_perlconfig_readconfig(configfile); … … 269 285 270 286 /* execute the startup function in the configfile */ 287 owl_function_debugmsg("startup: executing perl startup, if applicable"); 271 288 perlout = owl_perlconfig_execute("owl::startup();"); 272 289 if (perlout) owl_free(perlout); 273 owl_function_debugmsg("-- Owl Startup --");274 290 275 291 /* hold on to the window names for convenience */ … … 281 297 282 298 /* welcome message */ 299 owl_function_debugmsg("startup: creating splash message"); 283 300 strcpy(startupmsg, "-----------------------------------------------------------------------\n"); 284 301 sprintf(buff, "Welcome to Owl version %s. Press 'h' for on-line help. \n", OWL_VERSION_STRING); … … 298 315 /* load zephyr subs */ 299 316 if (initialsubs) { 317 owl_function_debugmsg("startup: loading initial zephyr subs"); 300 318 /* load normal subscriptions */ 301 319 ret=owl_zephyr_loadsubs(NULL); … … 312 330 /* load login subscriptions */ 313 331 if (owl_global_is_loginsubs(&g)) { 332 owl_function_debugmsg("startup: loading login subs"); 314 333 owl_function_loadloginsubs(NULL); 315 334 } … … 318 337 /* set the startup and default style, based on userclue and presence of a 319 338 * formatting function */ 339 owl_function_debugmsg("startup: setting startup and default style"); 320 340 if (0 != strcmp(owl_global_get_default_style(&g), "__unspecified__")) { 321 341 /* the style was set by the user: leave it alone */ … … 330 350 /* zlog in if we need to */ 331 351 if (owl_global_is_startuplogin(&g)) { 352 owl_function_debugmsg("startup: doing zlog in"); 332 353 owl_zephyr_zlog_in(); 333 354 } 334 355 356 owl_function_debugmsg("startup: set style for the view"); 335 357 owl_view_set_style(owl_global_get_current_view(&g), 336 358 owl_global_get_style_by_name(&g, owl_global_get_default_style(&g))); 337 359 360 owl_function_debugmsg("startup: setting context interactive"); 338 361 owl_context_set_interactive(owl_global_get_context(&g)); 339 362 … … 341 364 nexttime=time(NULL); 342 365 366 owl_function_debugmsg("startup: entering main loop"); 343 367 /* main loop */ 344 368 while (1) {
Note: See TracChangeset
for help on using the changeset viewer.