Changeset 37eab7f for functions.c
- Timestamp:
- Oct 25, 2003, 11:53:43 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:
- eec69e1
- Parents:
- 8c92848
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r8c92848 r37eab7f 208 208 } 209 209 210 int owl_function_make_outgoing_loopback(char *body) 211 { 212 owl_message *m; 213 int followlast; 214 215 followlast=owl_global_should_followlast(&g); 216 217 /* create the message */ 218 m=owl_malloc(sizeof(owl_message)); 219 owl_message_create_loopback(m, body); 220 owl_message_set_direction_out(m); 221 222 /* add it to the global list and current view */ 223 owl_messagelist_append_element(owl_global_get_msglist(&g), m); 224 owl_view_consider_message(owl_global_get_current_view(&g), m); 225 226 if (followlast) owl_function_lastmsg_noredisplay(); 227 228 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 229 if (owl_popwin_is_active(owl_global_get_popwin(&g))) { 230 owl_popwin_refresh(owl_global_get_popwin(&g)); 231 } 232 233 wnoutrefresh(owl_global_get_curs_recwin(&g)); 234 owl_global_set_needrefresh(&g); 235 return(0); 236 } 237 210 238 void owl_function_zwrite_setup(char *line) 211 239 { … … 280 308 281 309 owl_global_set_buffercommand(&g, line); 310 } 311 312 void owl_function_loopwrite_setup() 313 { 314 owl_editwin *e; 315 316 /* create and setup the editwin */ 317 e=owl_global_get_typwin(&g); 318 owl_editwin_new_style(e, OWL_EDITWIN_STYLE_MULTILINE, owl_global_get_msg_history(&g)); 319 320 if (!owl_global_get_lockout_ctrld(&g)) { 321 owl_function_makemsg("Type your message below. End with ^D or a dot on a line by itself. ^C will quit."); 322 } else { 323 owl_function_makemsg("Type your message below. End with a dot on a line by itself. ^C will quit."); 324 } 325 326 owl_editwin_clear(e); 327 owl_editwin_set_dotsend(e); 328 owl_editwin_set_locktext(e, "----> loopwrite\n"); 329 330 /* make it active */ 331 owl_global_set_typwin_active(&g); 332 333 owl_global_set_buffercommand(&g, "loopwrite"); 282 334 } 283 335 … … 397 449 if (owl_global_is_logging(&g)) { 398 450 owl_log_outgoing_aim(to, owl_editwin_get_text(owl_global_get_typwin(&g))); 451 } 452 } 453 454 void owl_function_loopwrite() 455 { 456 owl_message *m; 457 458 /* create a message and put it on the message queue. This simulates 459 * an incoming message */ 460 m=owl_malloc(sizeof(owl_message)); 461 owl_message_create_loopback(m, owl_editwin_get_text(owl_global_get_typwin(&g))); 462 owl_message_set_direction_out(m); 463 owl_global_messagequeue_addmsg(&g, m); 464 465 /* display the message as an outgoing message in the receive window */ 466 if (owl_global_is_displayoutgoing(&g)) { 467 owl_function_make_outgoing_loopback(owl_editwin_get_text(owl_global_get_typwin(&g))); 468 } 469 470 /* fake a makemsg */ 471 owl_function_makemsg("loopback message sent"); 472 473 /* log it if we have logging turned on */ 474 if (owl_global_is_logging(&g)) { 475 owl_log_outgoing_loopback(owl_editwin_get_text(owl_global_get_typwin(&g))); 399 476 } 400 477 } … … 1079 1156 } else if (!strncmp(buff, "aimwrite ", 9)) { 1080 1157 owl_function_aimwrite(buff+9); 1158 } else if (!strncmp(buff, "loopwrite", 9) || !strncmp(buff, "loopwrite ", 10)) { 1159 owl_function_loopwrite(); 1081 1160 } else if (!strncmp(buff, "aimlogin ", 9)) { 1082 1161 ptr=owl_sprintf("%s %s", buff, owl_global_get_response(&g)); 1083 1162 owl_function_command(ptr); 1084 1163 owl_free(ptr); 1164 } else { 1165 owl_function_error("Internal error: invalid buffercommand %s", buff); 1085 1166 } 1086 1167 } … … 1282 1363 1283 1364 owl_fmtext_append_normal(&fm, " Type : "); 1284 owl_fmtext_append_bold(&fm, owl_message_ type_to_string(m));1365 owl_fmtext_append_bold(&fm, owl_message_get_type(m)); 1285 1366 owl_fmtext_append_normal(&fm, "\n"); 1286 1367 … … 1946 2027 owl_context_set_editline(owl_global_get_context(&g), tw); 1947 2028 owl_function_activate_keymap("editline"); 1948 1949 2029 } 1950 2030
Note: See TracChangeset
for help on using the changeset viewer.