Changeset e5da3fe
- Timestamp:
- Mar 24, 2011, 4:24:25 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- a5b5d00
- Parents:
- 283ff1e
- git-author:
- DD Liu <liudi@mit.edu> (11/06/10 22:35:54)
- git-committer:
- David Benjamin <davidben@mit.edu> (03/24/11 16:24:25)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
rc809f5e re5da3fe 250 250 } 251 251 252 /* Create an outgoing zephyr message and return a pointer to it. Does253 * not put it on the global queue, use owl_global_messagequeue_addmsg() for254 * that.252 /* Queues outgoing zephyrs; if z sends to n people, queue n messages 253 * (except in case of cc). If there are no recipients queues 1 254 * message. 255 255 */ 256 owl_message *owl_function_make_outgoing_zephyr(const owl_zwrite *z) 257 { 258 owl_message *m; 259 260 /* create the message */ 261 m=g_new(owl_message, 1); 262 owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z)); 263 264 return(m); 256 void owl_function_add_outgoing_zephyrs(const owl_zwrite *z) 257 { 258 if (z->cc || owl_zwrite_get_numrecips(z) == 0) { 259 /* create the message */ 260 owl_message *m = g_new(owl_message, 1); 261 owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z), 0); 262 263 owl_global_messagequeue_addmsg(&g, m); 264 } else { 265 int i; 266 for (i = 0; i < owl_zwrite_get_numrecips(z); i++) { 267 /* create the message */ 268 owl_message *m = g_new(owl_message, 1); 269 owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z), i); 270 271 owl_global_messagequeue_addmsg(&g, m); 272 } 273 } 265 274 } 266 275 … … 268 277 * message or NULL if we're not logged into AIM (and thus unable to 269 278 * create the message). Does not put it on the global queue. Use 270 * owl_global_messagequeue_addmsg() for that 279 * owl_global_messagequeue_addmsg() for that. 271 280 */ 272 281 owl_message *owl_function_make_outgoing_aim(const char *body, const char *to) … … 378 387 } 379 388 380 /* send, log and display an outgoing zephyr. If 'msg' is NULL381 * themessage is expected to be set from the zwrite line itself389 /* send, log and display outgoing zephyrs. If 'msg' is NULL the 390 * message is expected to be set from the zwrite line itself 382 391 */ 383 392 #ifdef HAVE_LIBZEPHYR 384 393 void owl_function_zwrite(owl_zwrite *z, const char *msg) 385 394 { 386 owl_message *m;387 395 int ret; 388 396 … … 407 415 if (owl_zwrite_is_personal(z)) { 408 416 /* create the outgoing message */ 409 m=owl_function_make_outgoing_zephyr(z); 410 411 if (m) { 412 owl_global_messagequeue_addmsg(&g, m); 413 } else { 414 owl_function_error("Could not create outgoing zephyr message"); 415 } 417 owl_function_add_outgoing_zephyrs(z); 416 418 } 417 419 } … … 421 423 #endif 422 424 423 /* send, log and display an outgoing zcrypt zephyr. If 'msg' is NULL425 /* send, log and display outgoing zcrypt zephyrs. If 'msg' is NULL 424 426 * the message is expected to be set from the zwrite line itself 425 427 */ … … 427 429 { 428 430 char *cryptmsg; 429 owl_message *m;430 431 const char *argv[7]; 431 432 char *zcrypt; … … 469 470 /* Create the outgoing message. Restore the un-crypted message for display. */ 470 471 owl_zwrite_set_message_raw(z, old_msg); 471 m=owl_function_make_outgoing_zephyr(z); 472 if (m) { 473 owl_global_messagequeue_addmsg(&g, m); 474 } else { 475 owl_function_error("Could not create outgoing zephyr message"); 476 } 472 owl_function_add_outgoing_zephyrs(z); 477 473 } 478 474 -
logging.c
re3a75ed re5da3fe 186 186 */ 187 187 m = g_new(owl_message, 1); 188 owl_message_create_from_zwrite(m, zw, text); 188 /* recip_index = 0 because there can only be one recipient anyway */ 189 owl_message_create_from_zwrite(m, zw, text, 0); 189 190 if (!owl_log_shouldlog_message(m)) { 190 191 owl_message_delete(m); -
message.c
rf54b07d re5da3fe 958 958 } 959 959 960 void owl_message_create_from_zwrite(owl_message *m, const owl_zwrite *z, const char *body )960 void owl_message_create_from_zwrite(owl_message *m, const owl_zwrite *z, const char *body, int recip_index) 961 961 { 962 962 char *replyline; … … 970 970 owl_message_set_class(m, owl_zwrite_get_class(z)); 971 971 owl_message_set_instance(m, owl_zwrite_get_instance(z)); 972 if (owl_zwrite_get_numrecips(z)>0) { 973 char *longzuser = long_zuser(owl_zwrite_get_recip_n(z, 0)); 974 owl_message_set_recipient(m, 975 longzuser); /* only gets the first user, must fix */ 972 if (recip_index < owl_zwrite_get_numrecips(z)) { 973 char *longzuser = long_zuser(owl_zwrite_get_recip_n(z, recip_index)); 974 owl_message_set_recipient(m, longzuser); 976 975 g_free(longzuser); 977 976 } -
zephyr.c
r7d969f3 re5da3fe 851 851 #ifdef HAVE_LIBZEPHYR 852 852 char *tmpbuff, *myuser, *to; 853 owl_message *mout;854 853 owl_zwrite *z; 855 854 … … 898 897 899 898 /* display the message as an admin message in the receive window */ 900 mout=owl_function_make_outgoing_zephyr(z); 901 owl_global_messagequeue_addmsg(&g, mout); 899 owl_function_add_outgoing_zephyrs(z); 902 900 owl_zwrite_delete(z); 903 901 #endif
Note: See TracChangeset
for help on using the changeset viewer.