Changeset b45293f for functions.c
- Timestamp:
- Oct 11, 2002, 11:56:23 PM (22 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:
- 68b41b0
- Parents:
- 2adaf1d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r2adaf1d rb45293f 82 82 } 83 83 84 void owl_function_make_outgoing_zephyr(char * header, char *body, char *zwriteline, char *zsig) {84 void owl_function_make_outgoing_zephyr(char *body, char *zwriteline, char *zsig) { 85 85 owl_message *m; 86 86 int followlast; 87 87 owl_zwrite z; 88 char *tobuff, *recip;89 88 90 89 followlast=owl_global_should_followlast(&g); … … 93 92 owl_zwrite_create_from_line(&z, zwriteline); 94 93 95 /* in 'tobuff' place the "Message sent to foo" string.96 * Right now this only works for one recipient */97 tobuff=owl_malloc(strlen(owl_zwrite_get_recip_n(&z, 0))+100);98 sprintf(tobuff, "Zephyr sent to %s (Zsig: %s)", owl_zwrite_get_recip_n(&z, 0), zsig);99 100 94 /* create the message */ 101 95 m=owl_malloc(sizeof(owl_message)); 102 owl_message_create(m, tobuff, body); 103 owl_message_set_direction_out(m); 104 owl_message_set_type_zephyr(m); 105 106 /* set zwriteline */ 107 owl_message_set_zwriteline(m, zwriteline); 108 109 owl_message_set_class(m, owl_zwrite_get_class(&z)); 110 owl_message_set_instance(m, owl_zwrite_get_instance(&z)); 111 owl_message_set_opcode(m, owl_zwrite_get_opcode(&z)); 112 owl_message_set_realm(m, owl_zwrite_get_realm(&z)); 113 owl_message_set_sender(m, ZGetSender()); 114 /* this only gets the first recipient for now, must fix */ 115 recip=long_zuser(owl_zwrite_get_recip_n(&z, 0)); 116 owl_message_set_recipient(m, recip); 117 owl_free(recip); 96 owl_message_create_from_zwriteline(m, zwriteline, body, zsig); 118 97 119 98 /* add it to the global list */ … … 130 109 wnoutrefresh(owl_global_get_curs_recwin(&g)); 131 110 owl_global_set_needrefresh(&g); 132 owl_free(tobuff);133 111 owl_zwrite_free(&z); 134 112 } … … 176 154 177 155 void owl_function_zwrite(char *line) { 178 char *tmpbuff,buff[1024];156 char buff[1024]; 179 157 owl_zwrite z; 180 158 int i, j; … … 188 166 if (owl_global_is_displayoutgoing(&g) && owl_zwrite_is_personal(&z)) { 189 167 owl_zwrite_get_recipstr(&z, buff); 190 tmpbuff = owl_sprintf("Message sent to %s", buff); 191 owl_function_make_outgoing_zephyr(tmpbuff, owl_editwin_get_text(owl_global_get_typwin(&g)), line, owl_zwrite_get_zsig(&z)); 192 owl_free(tmpbuff); 168 owl_function_make_outgoing_zephyr(owl_editwin_get_text(owl_global_get_typwin(&g)), line, owl_zwrite_get_zsig(&z)); 193 169 } 194 170 … … 953 929 if (owl_global_is_bell(&g)) { 954 930 beep(); 931 owl_global_set_needrefresh(&g); /* do we really need this? */ 955 932 } 956 933 }
Note: See TracChangeset
for help on using the changeset viewer.