Changes in / [87d7e14:822e9bd]
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r39a531d rf89cc6f 96 96 OWLCMD_ARGS("unbindkey", owl_command_unbindkey, OWL_CTX_ANY, 97 97 "removes a binding in a keymap", 98 " unbindkey <keymap> <keyseq>",98 "bindkey <keymap> <keyseq>", 99 99 "Removes a binding of a key sequence within a keymap.\n" 100 100 "Use 'show keymaps' to see the existing keymaps.\n" … … 1778 1778 1779 1779 if (argc < 3) { 1780 owl_function_makemsg("Usage: unbindkey <keymap> <binding>");1780 owl_function_makemsg("Usage: bindkey <keymap> <binding>"); 1781 1781 return NULL; 1782 1782 } -
doc/barnowl.1
r8135737 rbad4496 35 35 .TP 36 36 \fB\-c\fP, \fB\-\-config\-file\fP=\fIFILE\fP 37 Specify an alternate config file for \fBBarnOwl\fP to use. The config file is 38 an arbitrary Perl script evaluated in the \fImain\fP package, and if it 39 overrides the \fIBarnOwl::startup\fP method that is run when \fBBarnOwl\fP 40 starts. (Compare \fI~/.owl/startup\fP, which contains \fBBarnOwl\fP commands 41 that are run at startup after the config file is loaded.) 42 43 By default, \fBBarnOwl\fP uses the first of \fI~/.owl/init.pl\fP, 44 \fI~/.barnowlconf\fP, or \fI~/.owlconf\fP that exists. 37 Specify an alternate config file for \fBBarnOwl\fP to use. By default, 38 \fBBarnOwl\fP uses \fI~/.barnowlconf\fP if it exists, and \fI~/.owlconf\fP otherwise. 45 39 46 40 .TP -
functions.c
rbd482c3 r7803326 216 216 void owl_function_add_outgoing_zephyrs(const owl_zwrite *z) 217 217 { 218 if (z->cc && owl_zwrite_is_personal(z)) {218 if (z->cc || owl_zwrite_get_numrecips(z) == 0) { 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 232 227 /* create the message */ 233 m = g_new(owl_message, 1);228 owl_message *m = g_new(owl_message, 1); 234 229 owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z), i); 235 230 … … 378 373 owl_function_makemsg("Waiting for ack..."); 379 374 380 /* create the outgoing message */ 381 owl_function_add_outgoing_zephyrs(z); 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 } 382 380 } 383 381 #else … … 429 427 owl_function_makemsg("Waiting for ack..."); 430 428 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 435 /* Clean up. */ 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 } 435 436 /* free the zwrite */ 436 437 g_free(cryptmsg); 437 g_free(old_msg);438 438 } 439 439 -
global.c
r219f52c r9078f69 75 75 g_free(cd); 76 76 77 g->msglist = owl_messagelist_new();77 owl_messagelist_create(&(g->msglist)); 78 78 79 79 _owl_global_init_windows(g); … … 109 109 110 110 /* Create the widgets */ 111 g->mw = owl_mainwin_new(g->mainpanel.recwin);111 owl_mainwin_init(&(g->mw), g->mainpanel.recwin); 112 112 owl_msgwin_init(&(g->msgwin), g->mainpanel.msgwin); 113 113 owl_sepbar_init(g->mainpanel.sepwin); … … 241 241 /* windows */ 242 242 243 owl_mainwin *owl_global_get_mainwin(owl_global *g) 244 { 245 return g->mw; 243 owl_mainwin *owl_global_get_mainwin(owl_global *g) { 244 return(&(g->mw)); 246 245 } 247 246 … … 257 256 258 257 owl_messagelist *owl_global_get_msglist(owl_global *g) { 259 return g->msglist;258 return(&(g->msglist)); 260 259 } 261 260 -
mainwin.c
rab88b05 r099597c 4 4 static void owl_mainwin_resized(owl_window *w, void *user_data); 5 5 6 CALLER_OWN owl_mainwin *owl_mainwin_new(owl_window *window)6 void owl_mainwin_init(owl_mainwin *mw, owl_window *window) 7 7 { 8 owl_mainwin *mw = g_new(owl_mainwin, 1);9 8 mw->curtruncated=0; 10 9 mw->lastdisplayed=-1; … … 17 16 /* For now, we do not bother with connecting up dependencies; that'll be a 18 17 * future refactor of the mainwin */ 19 20 return mw;21 18 } 22 19 -
message.c
rbff1f22 r6646fdb 836 836 837 837 838 /* set the "isprivate" attribute if it's a private zephyr. */ 839 if (owl_zwrite_recip_is_personal(n->z_recipient)) { 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 != '@') { 840 842 owl_message_set_isprivate(m); 841 843 } -
messagelist.c
r219f52c rf271129 1 1 #include "owl.h" 2 2 3 CALLER_OWN owl_messagelist *owl_messagelist_new(void)3 void owl_messagelist_create(owl_messagelist *ml) 4 4 { 5 owl_messagelist *ml = g_new(owl_messagelist, 1);6 5 ml->list = g_ptr_array_new(); 7 return ml;8 6 } 9 7 10 void owl_messagelist_ delete(owl_messagelist *ml, bool free_messages)8 void owl_messagelist_cleanup(owl_messagelist *ml, bool free_messages) 11 9 { 12 10 if (free_messages) 13 11 g_ptr_array_foreach(ml->list, (GFunc)owl_message_delete, NULL); 14 12 g_ptr_array_free(ml->list, true); 15 g_free(ml);16 13 } 17 14 -
owl.c
r8135737 r3b17b57 41 41 fprintf(stderr, " -v,--version print the Barnowl version number and exit\n"); 42 42 fprintf(stderr, " -h,--help print this help message\n"); 43 fprintf(stderr, " -c,--config-file specify an alternate config file\n"); 43 44 fprintf(stderr, " -s,--config-dir specify an alternate config dir (default ~/.owl)\n"); 44 fprintf(stderr, " -c,--config-file specify an alternate config file (default ~/.owl/init.pl)\n");45 45 fprintf(stderr, " -t,--tty set the tty name\n"); 46 46 } … … 585 585 ); 586 586 587 owl_function_debugmsg("startup: setting context interactive");588 589 owl_global_pop_context(&g);590 owl_global_push_context(&g, OWL_CTX_INTERACTIVE|OWL_CTX_RECV, NULL, "recv", NULL);591 592 587 /* process the startup file */ 593 588 owl_function_debugmsg("startup: processing startup file"); … … 601 596 owl_function_error("No such style: %s", owl_global_get_default_style(&g)); 602 597 598 owl_function_debugmsg("startup: setting context interactive"); 599 600 owl_global_pop_context(&g); 601 owl_global_push_context(&g, OWL_CTX_INTERACTIVE|OWL_CTX_RECV, NULL, "recv", NULL); 602 603 603 source = owl_window_redraw_source_new(); 604 604 g_source_attach(source, NULL); -
owl.h
r219f52c rb9517cf 452 452 char *name; 453 453 owl_filter *filter; 454 owl_messagelist *ml;454 owl_messagelist ml; 455 455 const owl_style *style; 456 456 int cachedmsgid; … … 533 533 534 534 typedef struct _owl_global { 535 owl_mainwin *mw;535 owl_mainwin mw; 536 536 owl_popwin *pw; 537 537 owl_msgwin msgwin; … … 551 551 int curmsg_vert_offset; 552 552 owl_view current_view; 553 owl_messagelist *msglist;553 owl_messagelist msglist; 554 554 WINDOW *input_pad; 555 555 owl_mainpanel mainpanel; -
perl/lib/BarnOwl.pm
r8135737 r7803326 329 329 our @all_commands; 330 330 331 if(!$configfile) { 332 if (-f get_config_dir() . "/init.pl") { 333 $configfile = get_config_dir() . "/init.pl"; 334 } elsif (-f $ENV{HOME} . "/.barnowlconf") { 335 $configfile = $ENV{HOME} . "/.barnowlconf"; 336 } else { 337 $configfile = $ENV{HOME}."/.owlconf"; 338 } 339 } 331 if(!$configfile && -f $ENV{HOME} . "/.barnowlconf") { 332 $configfile = $ENV{HOME} . "/.barnowlconf"; 333 } 334 $configfile ||= $ENV{HOME}."/.owlconf"; 340 335 341 336 # populate global variable space for legacy owlconf files -
perl/lib/BarnOwl/Message/Zephyr.pm
rbf70350 redd0be7 171 171 $class = $self->class; 172 172 $instance = $self->instance; 173 if ($self->recipient eq '' || $self->recipient =~ /^@/) { 173 if ($self->recipient eq '*' || $self->recipient eq '') { 174 $to = ''; 175 } elsif ($self->recipient =~ /^@/) { 174 176 $to = $self->recipient; 175 177 } else { -
perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
r678f607 rb8a3e00 1482 1482 } 1483 1483 1484 sub complete_jabberlogout {1485 my $ctx = shift;1486 if($ctx->word == 1) {1487 return ("-A", complete_account() );1488 } else {1489 return ();1490 }1491 }1492 1493 1484 BarnOwl::Completion::register_completer(jwrite => sub { BarnOwl::Module::Jabber::complete_jwrite(@_) }); 1494 BarnOwl::Completion::register_completer(jabberlogout => sub { BarnOwl::Module::Jabber::complete_jabberlogout(@_) });1495 1485 1496 1486 1; -
variable.c
rd126a19 rf271129 116 116 "both,in,out"), 117 117 118 OWLVAR_BOOL_FULL( "colorztext" /* %OwlVarStub */, 1, 119 "allow @color() in zephyrs to change color", 120 NULL, NULL, owl_variable_colorztext_set, NULL), 118 OWLVAR_BOOL( "colorztext" /* %OwlVarStub */, 1, 119 "allow @color() in zephyrs to change color", 120 "Note that only messages received after this variable\n" 121 "is set will be affected." ), 121 122 122 123 OWLVAR_BOOL( "fancylines" /* %OwlVarStub */, 1, … … 495 496 } 496 497 return owl_variable_bool_set_default(v, newval); 497 }498 499 int owl_variable_colorztext_set(owl_variable *v, const void *newval)500 {501 int ret = owl_variable_bool_set_default(v, newval);502 /* flush the format cache so that we see the update, but only if we're done initializing BarnOwl */503 if (owl_global_get_msglist(&g) != NULL)504 owl_messagelist_invalidate_formats(owl_global_get_msglist(&g));505 if (owl_global_get_mainwin(&g) != NULL) {506 owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS);507 owl_mainwin_redisplay(owl_global_get_mainwin(&g));508 }509 return ret;510 498 } 511 499 -
view.c
r219f52c rf271129 6 6 v->filter=f; 7 7 v->style=s; 8 v->ml = owl_messagelist_new();8 owl_messagelist_create(&(v->ml)); 9 9 owl_view_recalculate(v); 10 10 } … … 19 19 { 20 20 if (owl_filter_message_match(v->filter, m)) { 21 owl_messagelist_append_element( v->ml, m);21 owl_messagelist_append_element(&(v->ml), m); 22 22 } 23 23 } … … 30 30 int i, j; 31 31 const owl_messagelist *gml; 32 owl_messagelist *ml; 32 33 owl_message *m; 33 34 34 35 gml=owl_global_get_msglist(&g); 36 ml=&(v->ml); 35 37 36 38 /* nuke the old list, don't free the messages */ 37 owl_messagelist_ delete(v->ml, false);38 v->ml = owl_messagelist_new();39 owl_messagelist_cleanup(ml, false); 40 owl_messagelist_create(&(v->ml)); 39 41 40 42 /* find all the messages we want */ … … 43 45 m=owl_messagelist_get_element(gml, i); 44 46 if (owl_filter_message_match(v->filter, m)) { 45 owl_messagelist_append_element( v->ml, m);47 owl_messagelist_append_element(ml, m); 46 48 } 47 49 } … … 70 72 owl_message *owl_view_get_element(const owl_view *v, int index) 71 73 { 72 return owl_messagelist_get_element(v->ml, index);74 return(owl_messagelist_get_element(&(v->ml), index)); 73 75 } 74 76 75 77 void owl_view_delete_element(owl_view *v, int index) 76 78 { 77 owl_messagelist_delete_element( v->ml, index);79 owl_messagelist_delete_element(&(v->ml), index); 78 80 } 79 81 80 82 void owl_view_undelete_element(owl_view *v, int index) 81 83 { 82 owl_messagelist_undelete_element( v->ml, index);84 owl_messagelist_undelete_element(&(v->ml), index); 83 85 } 84 86 85 87 int owl_view_get_size(const owl_view *v) 86 88 { 87 return owl_messagelist_get_size(v->ml);89 return(owl_messagelist_get_size(&(v->ml))); 88 90 } 89 91 … … 156 158 void owl_view_cleanup(owl_view *v) 157 159 { 158 owl_messagelist_ delete(v->ml, false);160 owl_messagelist_cleanup(&v->ml, false); 159 161 g_free(v->name); 160 162 } -
zephyr.c
rf183917 rd953ede 697 697 Code_t ret; 698 698 ZNotice_t notice; 699 char *zsender = NULL;700 699 701 700 memset(¬ice, 0, sizeof(notice)); … … 709 708 notice.z_class=zstr(class); 710 709 notice.z_class_inst=zstr(instance); 711 if (!strcmp(recipient, "@")) { 710 notice.z_sender=NULL; 711 if (!strcmp(recipient, "*") || !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)); 713 715 } else { 714 716 notice.z_recipient=zstr(recipient); 715 717 } 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);733 732 if (ret != ZERR_NONE) { 734 733 owl_function_error("Error sending zephyr: %s", error_message(ret)); … … 790 789 } else if (!strcmp(retnotice->z_message, ZSRVACK_NOTSENT)) { 791 790 if (retnotice->z_recipient == NULL 792 || !owl_zwrite_recip_is_personal(retnotice->z_recipient)) { 791 || *retnotice->z_recipient == 0 792 || *retnotice->z_recipient == '@') { 793 793 char *buff; 794 794 owl_function_error("No one subscribed to class %s", retnotice->z_class); -
zwrite.c
r919cbf2 ref4074b 182 182 } 183 183 184 /* if there are no recipients we won't send a ping, which 185 is what we want */ 184 186 for (i = 0; i < z->recips->len; i++) { 185 187 to = owl_zwrite_get_recip_n_with_realm(z, i); 186 if (owl_zwrite_recip_is_personal(to)) 187 send_ping(to, z->class, z->inst); 188 send_ping(to, z->class, z->inst); 188 189 g_free(to); 189 190 } … … 206 207 g_free(z->message); 207 208 208 if (z-> cc && owl_zwrite_is_personal(z)) {209 if (z->recips->len > 0 && z->cc) { 209 210 message = g_string_new("CC: "); 210 211 for (i = 0; i < z->recips->len; i++) { … … 337 338 } 338 339 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) 340 int owl_zwrite_is_personal(const owl_zwrite *z) 345 341 { 346 342 /* return true if at least one of the recipients is personal */ 347 343 int i; 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; 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); 353 351 } 354 352
Note: See TracChangeset
for help on using the changeset viewer.