Changeset b43035e
- Timestamp:
- Jan 23, 2012, 6:41:42 PM (13 years ago)
- Parents:
- d126a19 (diff), bd482c3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
recfbdcc rbd482c3 216 216 void owl_function_add_outgoing_zephyrs(const owl_zwrite *z) 217 217 { 218 if (z->cc || owl_zwrite_get_numrecips(z) == 0) {218 if (z->cc && owl_zwrite_is_personal(z)) { 219 219 /* create the message */ 220 220 owl_message *m = g_new(owl_message, 1); … … 225 225 int i; 226 226 for (i = 0; i < owl_zwrite_get_numrecips(z); i++) { 227 owl_message *m; 228 229 if (!owl_zwrite_recip_is_personal(owl_zwrite_get_recip_n(z, i))) 230 continue; 231 227 232 /* create the message */ 228 owl_message *m = g_new(owl_message, 1);233 m = g_new(owl_message, 1); 229 234 owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z), i); 230 235 … … 373 378 owl_function_makemsg("Waiting for ack..."); 374 379 375 /* If it's personal */ 376 if (owl_zwrite_is_personal(z)) { 377 /* create the outgoing message */ 378 owl_function_add_outgoing_zephyrs(z); 379 } 380 /* create the outgoing message */ 381 owl_function_add_outgoing_zephyrs(z); 380 382 } 381 383 #else … … 427 429 owl_function_makemsg("Waiting for ack..."); 428 430 429 /* If it's personal */ 430 if (owl_zwrite_is_personal(z)) { 431 /* Create the outgoing message. Restore the un-crypted message for display. */ 432 owl_zwrite_set_message_raw(z, old_msg); 433 owl_function_add_outgoing_zephyrs(z); 434 } 431 /* Create the outgoing message. Restore the un-crypted message for display. */ 432 owl_zwrite_set_message_raw(z, old_msg); 433 owl_function_add_outgoing_zephyrs(z); 435 434 436 435 /* Clean up. */ -
message.c
r6646fdb rbff1f22 836 836 837 837 838 /* set the "isprivate" attribute if it's a private zephyr. 839 ``private'' means recipient is non-empty and doesn't start wit 840 `@' */ 841 if (*n->z_recipient && *n->z_recipient != '@') { 838 /* set the "isprivate" attribute if it's a private zephyr. */ 839 if (owl_zwrite_recip_is_personal(n->z_recipient)) { 842 840 owl_message_set_isprivate(m); 843 841 } -
perl/lib/BarnOwl/Message/Zephyr.pm
redd0be7 rbf70350 171 171 $class = $self->class; 172 172 $instance = $self->instance; 173 if ($self->recipient eq '*' || $self->recipient eq '') { 174 $to = ''; 175 } elsif ($self->recipient =~ /^@/) { 173 if ($self->recipient eq '' || $self->recipient =~ /^@/) { 176 174 $to = $self->recipient; 177 175 } else { -
zephyr.c
rd953ede rf183917 697 697 Code_t ret; 698 698 ZNotice_t notice; 699 char *zsender = NULL; 699 700 700 701 memset(¬ice, 0, sizeof(notice)); … … 708 709 notice.z_class=zstr(class); 709 710 notice.z_class_inst=zstr(instance); 710 notice.z_sender=NULL; 711 if (!strcmp(recipient, "*") || !strcmp(recipient, "@")) { 711 if (!strcmp(recipient, "@")) { 712 712 notice.z_recipient=zstr(""); 713 if (*owl_global_get_zsender(&g))714 notice.z_sender=zstr(owl_global_get_zsender(&g));715 713 } else { 716 714 notice.z_recipient=zstr(recipient); 717 715 } 716 if (!owl_zwrite_recip_is_personal(recipient) && *owl_global_get_zsender(&g)) 717 notice.z_sender = zsender = long_zuser(owl_global_get_zsender(&g)); 718 718 notice.z_default_format=zstr("Class $class, Instance $instance:\nTo: @bold($recipient) at $time $date\nFrom: @bold{$1 <$sender>}\n\n$2"); 719 719 if (opcode) notice.z_opcode=zstr(opcode); … … 730 730 g_free(notice.z_message); 731 731 ZFreeNotice(¬ice); 732 g_free(zsender); 732 733 if (ret != ZERR_NONE) { 733 734 owl_function_error("Error sending zephyr: %s", error_message(ret)); … … 789 790 } else if (!strcmp(retnotice->z_message, ZSRVACK_NOTSENT)) { 790 791 if (retnotice->z_recipient == NULL 791 || *retnotice->z_recipient == 0 792 || *retnotice->z_recipient == '@') { 792 || !owl_zwrite_recip_is_personal(retnotice->z_recipient)) { 793 793 char *buff; 794 794 owl_function_error("No one subscribed to class %s", retnotice->z_class); -
zwrite.c
ref4074b r919cbf2 182 182 } 183 183 184 /* if there are no recipients we won't send a ping, which185 is what we want */186 184 for (i = 0; i < z->recips->len; i++) { 187 185 to = owl_zwrite_get_recip_n_with_realm(z, i); 188 send_ping(to, z->class, z->inst); 186 if (owl_zwrite_recip_is_personal(to)) 187 send_ping(to, z->class, z->inst); 189 188 g_free(to); 190 189 } … … 207 206 g_free(z->message); 208 207 209 if (z-> recips->len > 0 && z->cc) {208 if (z->cc && owl_zwrite_is_personal(z)) { 210 209 message = g_string_new("CC: "); 211 210 for (i = 0; i < z->recips->len; i++) { … … 338 337 } 339 338 340 int owl_zwrite_is_personal(const owl_zwrite *z) 339 bool owl_zwrite_recip_is_personal(const char *recipient) 340 { 341 return recipient[0] && recipient[0] != '@'; 342 } 343 344 bool owl_zwrite_is_personal(const owl_zwrite *z) 341 345 { 342 346 /* return true if at least one of the recipients is personal */ 343 347 int i; 344 char *recip; 345 346 for (i = 0; i < z->recips->len; i++) { 347 recip = z->recips->pdata[i]; 348 if (recip[0] != '@') return 1; 349 } 350 return(0); 348 349 for (i = 0; i < z->recips->len; i++) 350 if (owl_zwrite_recip_is_personal(z->recips->pdata[i])) 351 return true; 352 return false; 351 353 } 352 354
Note: See TracChangeset
for help on using the changeset viewer.