Changeset 0ff8fb57
- Timestamp:
- Jun 1, 2003, 1:46:49 PM (20 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 31e48a3
- Parents:
- 440ce01
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.in
rd09e5a1 r0ff8fb57 34 34 OBJS = $(BASE_OBJS) $(GEN_O) 35 35 36 #AUTOGEN=$(GEN_C) $(GEN_H)37 AUTOGEN=$(GEN_C)36 AUTOGEN=$(GEN_C) $(GEN_H) 37 #AUTOGEN=$(GEN_C) 38 38 39 39 … … 53 53 $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core 54 54 55 #proto: owl_prototypes.h55 proto: owl_prototypes.h 56 56 57 57 perlglue.c: perlglue.xs … … 62 62 63 63 # Only move owl_prototypes.h into place if the new one is different 64 #owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS)65 # perl codelist.pl | grep -v ZWRITEOPTIONS> owl_prototypes.h.new66 #@cmp -s owl_prototypes.h.new $@ || { \67 #echo 'Interfaces changed!'; \68 #echo mv -f owl_prototypes.h.new $@; \69 #mv -f owl_prototypes.h.new $@; }70 owl_prototypes.h:64 owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS) 65 perl codelist.pl > owl_prototypes.h.new 66 @cmp -s owl_prototypes.h.new $@ || { \ 67 echo 'Interfaces changed!'; \ 68 echo mv -f owl_prototypes.h.new $@; \ 69 mv -f owl_prototypes.h.new $@; } 70 #owl_prototypes.h: 71 71 72 72 .PHONY: tags clean distclean proto test … … 77 77 etags $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) 78 78 79 #$(BASE_OBJS) varstubs.h:: owl.h config.h owl_prototypes.h80 $(BASE_OBJS) varstubs.h:: owl.h config.h79 $(BASE_OBJS) varstubs.h:: owl.h config.h owl_prototypes.h 80 #$(BASE_OBJS) varstubs.h:: owl.h config.h 81 81 82 82 libfaim: libfaim/libfaim.a -
aim.c
r440ce01 r0ff8fb57 26 26 }; 27 27 28 /* 28 29 static char *msgerrreasons[] = { 29 30 "Invalid error", … … 54 55 }; 55 56 static int msgerrreasonslen = 25; 57 */ 56 58 57 59 static void faimtest_debugcb(aim_session_t *sess, int level, const char *format, va_list va); … … 168 170 { 169 171 aim_send_im(owl_global_get_aimsess(&g), to, AIM_IMFLAGS_ACK, msg); 172 173 /* I don't know how to check for an error yet */ 174 return(0); 170 175 } 171 176 … … 180 185 int owl_aim_chat_sendmsg(char *chatroom, char *msg) 181 186 { 187 return(0); 182 188 } 183 189 184 190 int owl_aim_process_events() { 185 int ret;186 191 aim_session_t *aimsess; 187 192 aim_conn_t *waitingconn = NULL; … … 241 246 /* free(priv->buddyicon); */ 242 247 /* exit(0); */ 248 return(0); 243 249 } 244 250 … … 386 392 static int conninitdone_bos(aim_session_t *sess, aim_frame_t *fr, ...) 387 393 { 388 struct owlfaim_priv *priv = (struct owlfaim_priv *)sess->aux_data;389 394 char buddies[128]; /* this is the new buddy list */ 390 395 char profile[256]; /* this is the new profile */ … … 406 411 407 412 /*aim_bos_setprofile(sess, fr->conn, profile, awaymsg, AIM_CAPS_BUDDYICON | AIM_CAPS_CHAT | AIM_CAPS_GETFILE | AIM_CAPS_SENDFILE | AIM_CAPS_IMIMAGE | AIM_CAPS_GAMES | AIM_CAPS_SAVESTOCKS | AIM_CAPS_SENDBUDDYLIST | AIM_CAPS_ICQ | AIM_CAPS_ICQUNKNOWN | AIM_CAPS_ICQRTF | AIM_CAPS_ICQSERVERRELAY | AIM_CAPS_TRILLIANCRYPT); */ 408 aim_bos_setprofile(sess, fr->conn, profile, awaymsg, AIM_CAPS_SENDBUDDYLIST | AIM_CAPS_CHAT | AIM_CAPS_ICQ | AIM_CAPS_ICQUNKNOWN | AIM_CAPS_ICQRTF | AIM_CAPS_ICQSERVERRELAY | AIM_CAPS_TRILLIANCRYPT);413 aim_bos_setprofile(sess, fr->conn, profile, awaymsg, AIM_CAPS_SENDBUDDYLIST | AIM_CAPS_CHAT ); 409 414 aim_bos_reqbuddyrights(sess, fr->conn); 410 415 … … 473 478 int logout(aim_session_t *sess) 474 479 { 475 struct owlfaim_priv *priv = (struct owlfaim_priv *)sess->aux_data;476 477 480 aim_session_kill(sess); 478 481 … … 674 677 static int faimtest_parse_motd(aim_session_t *sess, aim_frame_t *fr, ...) 675 678 { 679 char *msg; 680 fu16_t id; 681 va_list ap; 682 /* static int codeslen = 5; 676 683 static char *codes[] = { 677 684 "Unknown", … … 681 688 "Top o' the world!" 682 689 }; 683 static int codeslen = 5; 684 char *msg; 685 fu16_t id; 686 va_list ap; 687 690 */ 691 688 692 return 1; 689 693 … … 1462 1466 static int faimtest_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) 1463 1467 { 1468 /* 1464 1469 static char *missedreasons[] = { 1465 1470 "Invalid (0)", … … 1469 1474 "Evil Receiver" 1470 1475 }; 1471 static int missedreasonslen = 5; 1476 static int missedreasonslen = 5; */ 1472 1477 1473 1478 va_list ap; … … 1508 1513 static int faimtest_parse_ratechange(aim_session_t *sess, aim_frame_t *fr, ...) 1509 1514 { 1515 /* 1510 1516 static char *codes[5] = { 1511 1517 "invalid", … … 1515 1521 "limit cleared" 1516 1522 }; 1523 */ 1517 1524 va_list ap; 1518 1525 fu16_t code, rateclass; … … 1587 1594 va_list ap; 1588 1595 char *address, *SNs; 1589 int i, num; 1596 int num; 1597 /* int i; */ 1590 1598 1591 1599 va_start(ap, fr); … … 1748 1756 va_list ap; 1749 1757 aim_userinfo_t *userinfo; 1750 int count, i; 1758 int count; 1759 /* int i; */ 1751 1760 1752 1761 va_start(ap, fr); … … 1765 1774 static int faimtest_chat_leave(aim_session_t *sess, aim_frame_t *fr, ...) 1766 1775 { 1767 va_list ap;1768 1776 aim_userinfo_t *userinfo; 1769 int count , i; 1777 va_list ap; 1778 int count; 1779 /* int i; */ 1780 1770 1781 1771 1782 va_start(ap, fr); … … 1789 1800 struct aim_chat_roominfo *roominfo; 1790 1801 char *roomname; 1791 int usercount , i;1802 int usercount; 1792 1803 char *roomdesc; 1793 1804 fu16_t flags, unknown_d2, unknown_d5, maxmsglen, maxvisiblemsglen; 1794 1805 fu32_t creationtime; 1795 1806 const char *croomname; 1807 /* int i; */ 1796 1808 1797 1809 croomname = aim_chat_getname(fr->conn); … … 1875 1887 int maxrooms; 1876 1888 struct aim_chat_exchangeinfo *exchanges; 1877 int exchangecount, i; 1889 int exchangecount; 1890 /* int i; */ 1878 1891 1879 1892 maxrooms = va_arg(ap, int); -
codelist.pl
r4594d83 r0ff8fb57 20 20 && !/^system/ 21 21 && !/^XS/ 22 && !/\/\*/) { 22 && !/\/\*/ 23 && !/ZWRITEOPTIONS/ 24 && !/owlfaim_priv/) 25 { 23 26 s/\s+\{/\;/; 24 27 s/\)[ \t]*$/\)\;/; -
commands.c
rd09e5a1 r0ff8fb57 1376 1376 1377 1377 char *owl_command_aimwrite(int argc, char **argv, char *buff) { 1378 char *tmpbuff , *pos, *cmd, *msg;1378 char *tmpbuff; 1379 1379 1380 1380 if (argc < 2) { -
functions.c
r440ce01 r0ff8fb57 1297 1297 owl_fmtext_append_normal(&fm, "\n"); 1298 1298 1299 owl_fmtext_append_normal(&fm, "Sender : "); 1300 owl_fmtext_append_normal(&fm, owl_message_get_sender(m)); 1301 owl_fmtext_append_normal(&fm, "\n"); 1302 1303 owl_fmtext_append_normal(&fm, "Recipient : "); 1304 owl_fmtext_append_normal(&fm, owl_message_get_recipient(m)); 1305 owl_fmtext_append_normal(&fm, "\n"); 1306 1307 1299 1308 if (owl_message_is_type_zephyr(m)) { 1300 1309 owl_fmtext_append_bold(&fm, " Zephyr Specific Info\n"); 1310 1301 1311 if (owl_message_is_direction_in(m)) { 1302 1312 n=owl_message_get_notice(m); … … 1306 1316 owl_fmtext_append_normal(&fm, "Instance : "); 1307 1317 owl_fmtext_append_normal(&fm, owl_message_get_instance(m)); 1308 owl_fmtext_append_normal(&fm, "\n");1309 owl_fmtext_append_normal(&fm, "Sender : ");1310 owl_fmtext_append_normal(&fm, owl_message_get_sender(m));1311 owl_fmtext_append_normal(&fm, "\n");1312 owl_fmtext_append_normal(&fm, "Recipient : ");1313 owl_fmtext_append_normal(&fm, owl_message_get_recipient(m));1314 1318 owl_fmtext_append_normal(&fm, "\n"); 1315 1319 owl_fmtext_append_normal(&fm, "Opcode : "); … … 1384 1388 } 1385 1389 1386 /* just for testing for now */1387 1390 for (j=0; j<strlen(tmpbuff); j++) { 1388 1391 if (tmpbuff[j]=='\n') tmpbuff[j]='~'; … … 1397 1400 owl_fmtext_append_normal(&fm, n->z_default_format); 1398 1401 } 1402 } 1403 1404 if (owl_message_is_type_aim(m)) { 1405 1399 1406 } 1400 1407 -
message.c
r440ce01 r0ff8fb57 14 14 static const char fileIdent[] = "$Id$"; 15 15 16 void owl_message_init(owl_message *m) { 16 void owl_message_init(owl_message *m) 17 { 17 18 time_t t; 18 19 … … 32 33 } 33 34 34 void owl_message_set_attribute(owl_message *m, char *attrname, char *attrvalue) { 35 void owl_message_set_attribute(owl_message *m, char *attrname, char *attrvalue) 36 { 35 37 /* add the named attribute to the message. If an attribute with the 36 38 name already exists, replace the old value with the new value */ … … 58 60 } 59 61 60 char *owl_message_get_attribute_value(owl_message *m, char *attrname) { 62 char *owl_message_get_attribute_value(owl_message *m, char *attrname) 63 { 61 64 /* return the value associated with the named attribute, or NULL if 62 65 the attribute does not exist */ … … 76 79 77 80 78 owl_fmtext *owl_message_get_fmtext(owl_message *m) { 81 owl_fmtext *owl_message_get_fmtext(owl_message *m) 82 { 79 83 return(&(m->fmtext)); 80 84 } 81 85 82 void owl_message_set_class(owl_message *m, char *class) { 86 void owl_message_set_class(owl_message *m, char *class) 87 { 83 88 owl_message_set_attribute(m, "class", class); 84 89 } 85 90 86 char *owl_message_get_class(owl_message *m) { 91 char *owl_message_get_class(owl_message *m) 92 { 87 93 char *class; 88 94 … … 92 98 } 93 99 94 void owl_message_set_instance(owl_message *m, char *inst) { 100 void owl_message_set_instance(owl_message *m, char *inst) 101 { 95 102 owl_message_set_attribute(m, "instance", inst); 96 103 } 97 104 98 char *owl_message_get_instance(owl_message *m) { 105 char *owl_message_get_instance(owl_message *m) 106 { 99 107 char *instance; 100 108 … … 104 112 } 105 113 106 void owl_message_set_sender(owl_message *m, char *sender) { 114 void owl_message_set_sender(owl_message *m, char *sender) 115 { 107 116 owl_message_set_attribute(m, "sender", sender); 108 117 } 109 118 110 char *owl_message_get_sender(owl_message *m) { 119 char *owl_message_get_sender(owl_message *m) 120 { 111 121 char *sender; 112 122 … … 116 126 } 117 127 118 void owl_message_set_zsig(owl_message *m, char *zsig) { 128 void owl_message_set_zsig(owl_message *m, char *zsig) 129 { 119 130 owl_message_set_attribute(m, "zsig", zsig); 120 131 } 121 132 122 char *owl_message_get_zsig(owl_message *m) { 133 char *owl_message_get_zsig(owl_message *m) 134 { 123 135 char *zsig; 124 136 … … 128 140 } 129 141 130 void owl_message_set_recipient(owl_message *m, char *recip) { 142 void owl_message_set_recipient(owl_message *m, char *recip) 143 { 131 144 owl_message_set_attribute(m, "recipient", recip); 132 145 } 133 146 134 char *owl_message_get_recipient(owl_message *m) { 147 char *owl_message_get_recipient(owl_message *m) 148 { 135 149 /* this is stupid for outgoing messages, we need to fix it. */ 136 150 137 151 char *recip; 138 139 if (m->type==OWL_MESSAGE_TYPE_ZEPHYR) { 140 recip=owl_message_get_attribute_value(m, "recipient"); 141 } else if (owl_message_is_direction_out(m)) { 142 recip=m->zwriteline; 143 } else { 144 recip=owl_message_get_attribute_value(m, "recipient"); 145 } 152 153 recip=owl_message_get_attribute_value(m, "recipient"); 146 154 if (!recip) return(""); 147 155 return(recip); 148 156 } 149 157 150 void owl_message_set_realm(owl_message *m, char *realm) { 158 void owl_message_set_realm(owl_message *m, char *realm) 159 { 151 160 owl_message_set_attribute(m, "realm", realm); 152 161 } 153 162 154 char *owl_message_get_realm(owl_message *m) { 163 char *owl_message_get_realm(owl_message *m) 164 { 155 165 char *realm; 156 166 … … 160 170 } 161 171 162 void owl_message_set_body(owl_message *m, char *body) { 172 void owl_message_set_body(owl_message *m, char *body) 173 { 163 174 owl_message_set_attribute(m, "body", body); 164 175 } 165 176 166 char *owl_message_get_body(owl_message *m) { 177 char *owl_message_get_body(owl_message *m) 178 { 167 179 char *body; 168 180 … … 173 185 174 186 175 void owl_message_set_opcode(owl_message *m, char *opcode) { 187 void owl_message_set_opcode(owl_message *m, char *opcode) 188 { 176 189 owl_message_set_attribute(m, "opcode", opcode); 177 190 } 178 191 179 char *owl_message_get_opcode(owl_message *m) { 192 char *owl_message_get_opcode(owl_message *m) 193 { 180 194 char *opcode; 181 195 … … 185 199 } 186 200 187 char *owl_message_get_timestr(owl_message *m) { 201 char *owl_message_get_timestr(owl_message *m) 202 { 188 203 return(m->time); 189 204 } 190 205 191 void owl_message_set_type_admin(owl_message *m) { 206 void owl_message_set_type_admin(owl_message *m) 207 { 192 208 m->type=OWL_MESSAGE_TYPE_ADMIN; 193 209 } 194 210 195 void owl_message_set_type_zephyr(owl_message *m) { 211 void owl_message_set_type_zephyr(owl_message *m) 212 { 196 213 m->type=OWL_MESSAGE_TYPE_ZEPHYR; 197 214 } 198 215 199 void owl_message_set_type_aim(owl_message *m) { 216 void owl_message_set_type_aim(owl_message *m) 217 { 200 218 m->type=OWL_MESSAGE_TYPE_AIM; 201 219 } 202 220 203 int owl_message_is_type_admin(owl_message *m) { 221 int owl_message_is_type_admin(owl_message *m) 222 { 204 223 if (m->type==OWL_MESSAGE_TYPE_ADMIN) return(1); 205 224 return(0); 206 225 } 207 226 208 int owl_message_is_type_zephyr(owl_message *m) { 227 int owl_message_is_type_zephyr(owl_message *m) 228 { 209 229 if (m->type==OWL_MESSAGE_TYPE_ZEPHYR) return(1); 210 230 return(0); 211 231 } 212 232 213 int owl_message_is_type_aim(owl_message *m) { 233 int owl_message_is_type_aim(owl_message *m) 234 { 214 235 if (m->type==OWL_MESSAGE_TYPE_AIM) return(1); 215 236 return(0); 216 237 } 217 238 218 int owl_message_is_type_generic(owl_message *m) { 239 int owl_message_is_type_generic(owl_message *m) 240 { 219 241 if (m->type==OWL_MESSAGE_TYPE_GENERIC) return(1); 220 242 return(0); 221 243 } 222 244 223 char *owl_message_get_text(owl_message *m) { 245 char *owl_message_get_text(owl_message *m) 246 { 224 247 return(owl_fmtext_get_text(&(m->fmtext))); 225 248 } 226 249 227 void owl_message_set_direction_in(owl_message *m) { 250 void owl_message_set_direction_in(owl_message *m) 251 { 228 252 m->direction=OWL_MESSAGE_DIRECTION_IN; 229 253 } 230 254 231 void owl_message_set_direction_out(owl_message *m) { 255 void owl_message_set_direction_out(owl_message *m) 256 { 232 257 m->direction=OWL_MESSAGE_DIRECTION_OUT; 233 258 } 234 259 235 void owl_message_set_direction_none(owl_message *m) { 260 void owl_message_set_direction_none(owl_message *m) 261 { 236 262 m->direction=OWL_MESSAGE_DIRECTION_NONE; 237 263 } 238 264 239 int owl_message_is_direction_in(owl_message *m) { 265 int owl_message_is_direction_in(owl_message *m) 266 { 240 267 if (m->direction==OWL_MESSAGE_DIRECTION_IN) return(1); 241 268 return(0); 242 269 } 243 270 244 int owl_message_is_direction_out(owl_message *m) { 271 int owl_message_is_direction_out(owl_message *m) 272 { 245 273 if (m->direction==OWL_MESSAGE_DIRECTION_OUT) return(1); 246 274 return(0); 247 275 } 248 276 249 int owl_message_is_direction_none(owl_message *m) { 277 int owl_message_is_direction_none(owl_message *m) 278 { 250 279 if (m->direction==OWL_MESSAGE_DIRECTION_NONE) return(1); 251 280 return(0); 252 281 } 253 282 254 int owl_message_get_numlines(owl_message *m) { 283 int owl_message_get_numlines(owl_message *m) 284 { 255 285 if (m == NULL) return(0); 256 286 return(owl_fmtext_num_lines(&(m->fmtext))); 257 287 } 258 288 259 void owl_message_mark_delete(owl_message *m) { 289 void owl_message_mark_delete(owl_message *m) 290 { 260 291 if (m == NULL) return; 261 292 m->delete=1; 262 293 } 263 294 264 void owl_message_unmark_delete(owl_message *m) { 295 void owl_message_unmark_delete(owl_message *m) 296 { 265 297 if (m == NULL) return; 266 298 m->delete=0; 267 299 } 268 300 269 char *owl_message_get_zwriteline(owl_message *m) { 301 char *owl_message_get_zwriteline(owl_message *m) 302 { 270 303 return(m->zwriteline); 271 304 } 272 305 273 void owl_message_set_zwriteline(owl_message *m, char *line) { 306 void owl_message_set_zwriteline(owl_message *m, char *line) 307 { 274 308 m->zwriteline=strdup(line); 275 309 } 276 310 277 int owl_message_is_delete(owl_message *m) { 311 int owl_message_is_delete(owl_message *m) 312 { 278 313 if (m == NULL) return(0); 279 314 if (m->delete==1) return(1); … … 281 316 } 282 317 283 ZNotice_t *owl_message_get_notice(owl_message *m) { 318 ZNotice_t *owl_message_get_notice(owl_message *m) 319 { 284 320 return(&(m->notice)); 285 321 } 286 322 287 char *owl_message_get_hostname(owl_message *m) { 323 char *owl_message_get_hostname(owl_message *m) 324 { 288 325 return(m->hostname); 289 326 } 290 327 291 328 292 void owl_message_curs_waddstr(owl_message *m, WINDOW *win, int aline, int bline, int acol, int bcol, int color) { 329 void owl_message_curs_waddstr(owl_message *m, WINDOW *win, int aline, int bline, int acol, int bcol, int color) 330 { 293 331 owl_fmtext a, b; 294 332 … … 312 350 } 313 351 314 int owl_message_is_personal(owl_message *m) { 315 if (strcasecmp(owl_message_get_class(m), "message")) return(0); 316 if (strcasecmp(owl_message_get_instance(m), "personal")) return(0); 317 if (!strcasecmp(owl_message_get_recipient(m), ZGetSender()) || 318 !strcasecmp(owl_message_get_sender(m), ZGetSender())) { 352 int owl_message_is_personal(owl_message *m) 353 { 354 if (owl_message_is_type_zephyr(m)) { 355 if (strcasecmp(owl_message_get_class(m), "message")) return(0); 356 if (strcasecmp(owl_message_get_instance(m), "personal")) return(0); 357 if (!strcasecmp(owl_message_get_recipient(m), ZGetSender()) || 358 !strcasecmp(owl_message_get_sender(m), ZGetSender())) { 359 return(1); 360 } 361 } 362 return(0); 363 } 364 365 /* true if the message is only intended for one recipient (me) */ 366 int owl_message_is_to_me(owl_message *m) 367 { 368 if (owl_message_is_type_zephyr(m)) { 369 if (!strcasecmp(owl_message_get_recipient(m), ZGetSender())) { 370 return(1); 371 } else { 372 return(0); 373 } 374 } else if (owl_message_is_type_aim(m)) { 375 /* right now we don't support chat rooms */ 319 376 return(1); 320 } 321 return(0); 322 } 323 324 int owl_message_is_private(owl_message *m) { 325 if (!strcasecmp(owl_message_get_recipient(m), ZGetSender())) return(1); 326 return(0); 327 } 328 329 int owl_message_is_mail(owl_message *m) { 330 if (!strcasecmp(owl_message_get_class(m), "mail") && owl_message_is_private(m)) { 377 } else if (owl_message_is_type_admin(m)) { 331 378 return(1); 332 379 } … … 334 381 } 335 382 336 int owl_message_is_ping(owl_message *m) { 337 if (!strcasecmp(owl_message_get_opcode(m), "ping")) return(1); 338 return(0); 339 } 340 341 int owl_message_is_login(owl_message *m) { 342 if (!strcasecmp(owl_message_get_class(m), "login")) return(1); 343 return(0); 344 /* is this good enough? */ 345 } 346 347 int owl_message_is_burningears(owl_message *m) { 383 384 int owl_message_is_from_me(owl_message *m) 385 { 386 if (owl_message_is_type_zephyr(m)) { 387 if (!strcasecmp(owl_message_get_sender(m), ZGetSender())) { 388 return(1); 389 } else { 390 return(0); 391 } 392 } else if (owl_message_is_type_aim(m)) { 393 if (!strcasecmp(owl_message_get_sender(m), owl_global_get_aim_screenname(&g))) { 394 return(1); 395 } else { 396 return(0); 397 } 398 } else if (owl_message_is_type_admin(m)) { 399 return(0); 400 } 401 return(0); 402 } 403 404 int owl_message_is_mail(owl_message *m) 405 { 406 if (owl_message_is_type_zephyr(m)) { 407 if (!strcasecmp(owl_message_get_class(m), "mail") && owl_message_is_to_me(m)) { 408 return(1); 409 } else { 410 return(0); 411 } 412 } 413 return(0); 414 } 415 416 int owl_message_is_ping(owl_message *m) 417 { 418 if (owl_message_is_type_zephyr(m)) { 419 if (!strcasecmp(owl_message_get_opcode(m), "ping")) { 420 return(1); 421 } else { 422 return(0); 423 } 424 } 425 return(0); 426 } 427 428 int owl_message_is_login(owl_message *m) 429 { 430 if (owl_message_is_type_zephyr(m)) { 431 if (!strcasecmp(owl_message_get_class(m), "login")) { 432 return(1); 433 } else { 434 return(0); 435 } 436 } else if (owl_message_is_type_aim(m)) { 437 /* deal with this once we can use buddy lists */ 438 return(0); 439 } 440 441 return(0); 442 } 443 444 int owl_message_is_burningears(owl_message *m) 445 { 348 446 /* we should add a global to cache the short zsender */ 349 447 char sender[LINE], *ptr; 350 448 351 449 /* if the message is from us or to us, it doesn't count */ 352 if (!strcasecmp(ZGetSender(), owl_message_get_sender(m))) return(0); 353 if (!strcasecmp(ZGetSender(), owl_message_get_recipient(m))) return(0); 354 355 strcpy(sender, ZGetSender()); 356 ptr=strchr(sender, '@'); 357 if (ptr) *ptr='\0'; 450 if (owl_message_is_from_me(m) || owl_message_is_to_me(m)) return(0); 451 452 if (owl_message_is_type_zephyr(m)) { 453 strcpy(sender, ZGetSender()); 454 ptr=strchr(sender, '@'); 455 if (ptr) *ptr='\0'; 456 } else if (owl_message_is_type_aim(m)) { 457 strcpy(sender, owl_global_get_aim_screenname(&g)); 458 } else { 459 return(0); 460 } 358 461 359 462 if (stristr(owl_message_get_body(m), sender)) { … … 364 467 365 468 /* caller must free return value. */ 366 char *owl_message_get_cc(owl_message *m) { 469 char *owl_message_get_cc(owl_message *m) 470 { 367 471 char *cur, *out, *end; 368 472 … … 378 482 } 379 483 380 int owl_message_get_id(owl_message *m) { 484 int owl_message_get_id(owl_message *m) 485 { 381 486 return(m->id); 382 487 } 383 488 384 int owl_message_search(owl_message *m, char *string) { 489 int owl_message_search(owl_message *m, char *string) 490 { 385 491 /* return 1 if the message contains "string", 0 otherwise. This is 386 492 * case insensitive because the functions it uses are */ … … 389 495 } 390 496 391 void owl_message_create(owl_message *m, char *header, char *text) { 497 void owl_message_create(owl_message *m, char *header, char *text) 498 { 392 499 char *indent; 393 500 … … 409 516 } 410 517 411 void owl_message_create_aim(owl_message *m, char *sender, char *recipient, char *text) { 518 void owl_message_create_aim(owl_message *m, char *sender, char *recipient, char *text) 519 { 412 520 char *indent; 413 521 … … 435 543 } 436 544 437 void owl_message_create_admin(owl_message *m, char *header, char *text) { 545 void owl_message_create_admin(owl_message *m, char *header, char *text) 546 { 438 547 char *indent; 439 548 … … 460 569 } 461 570 462 void owl_message_create_from_znotice(owl_message *m, ZNotice_t *n) { 571 void owl_message_create_from_znotice(owl_message *m, ZNotice_t *n) 572 { 463 573 struct hostent *hent; 464 574 int k; … … 552 662 } 553 663 554 void owl_message_create_from_zwriteline(owl_message *m, char *line, char *body, char *zsig) { 664 void owl_message_create_from_zwriteline(owl_message *m, char *line, char *body, char *zsig) 665 { 555 666 owl_zwrite z; 556 667 int ret; … … 593 704 } 594 705 595 void _owl_message_make_text_from_config(owl_message *m) { 706 void _owl_message_make_text_from_config(owl_message *m) 707 { 596 708 char *body, *indent; 597 709 … … 612 724 } 613 725 614 void _owl_message_make_text_from_zwriteline_standard(owl_message *m) { 726 void _owl_message_make_text_from_zwriteline_standard(owl_message *m) 727 { 615 728 char *indent, *text, *zsigbuff, *foo; 616 729 … … 642 755 } 643 756 644 void _owl_message_make_text_from_zwriteline_simple(owl_message *m) { 757 void _owl_message_make_text_from_zwriteline_simple(owl_message *m) 758 { 645 759 char *indent, *text, *zsigbuff, *foo; 646 760 … … 672 786 } 673 787 674 void _owl_message_make_text_from_notice_standard(owl_message *m) { 788 void _owl_message_make_text_from_notice_standard(owl_message *m) 789 { 675 790 char *body, *indent, *ptr, *zsigbuff, frombuff[LINE]; 676 791 ZNotice_t *n; … … 702 817 owl_fmtext_append_normal(&(m->fmtext), OWL_TABSTR); 703 818 704 if (!strcasecmp(owl_message_get_opcode(m), "ping") && owl_message_is_ private(m)) {819 if (!strcasecmp(owl_message_get_opcode(m), "ping") && owl_message_is_to_me(m)) { 705 820 owl_fmtext_append_bold(&(m->fmtext), "PING"); 706 821 owl_fmtext_append_normal(&(m->fmtext), " from "); … … 773 888 } 774 889 775 void _owl_message_make_text_from_notice_simple(owl_message *m) { 890 void _owl_message_make_text_from_notice_simple(owl_message *m) 891 { 776 892 char *body, *indent, *ptr, *zsigbuff, frombuff[LINE]; 777 893 ZNotice_t *n; … … 873 989 } 874 990 875 void owl_message_pretty_zsig(owl_message *m, char *buff) { 991 void owl_message_pretty_zsig(owl_message *m, char *buff) 992 { 876 993 /* stick a one line version of the zsig in buff */ 877 994 char *ptr; … … 882 999 } 883 1000 884 void owl_message_free(owl_message *m) { 1001 void owl_message_free(owl_message *m) 1002 { 885 1003 int i, j; 886 1004 owl_pair *p; -
owl_prototypes.h
r440ce01 r0ff8fb57 8 8 extern int owl_aim_chat_sendmsg(char *chatroom, char *msg); 9 9 extern int owl_aim_process_events(); 10 extern int faimtest_flapversion(aim_session_t *sess, aim_frame_t *fr, ...); 11 extern int faimtest_conncomplete(aim_session_t *sess, aim_frame_t *fr, ...); 12 extern void addcb_bos(aim_session_t *sess, aim_conn_t *bosconn); 13 extern int login(aim_session_t *sess, const char *sn, const char *passwd); 14 extern int logout(aim_session_t *sess); 15 extern int faimtest_parse_genericerr(aim_session_t *sess, aim_frame_t *fr, ...); 16 extern void chatnav_redirect(aim_session_t *sess, struct aim_redirect_data *redir); 17 extern void chat_redirect(aim_session_t *sess, struct aim_redirect_data *redir); 18 extern void getfile_start(aim_session_t *sess, aim_conn_t *conn, const char *sn); 19 extern void getfile_requested(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args); 20 extern void directim_start(aim_session_t *sess, const char *sn); 21 extern void directim_requested(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args); 10 22 11 23 /* -------------------------------- cmd.c -------------------------------- */ … … 267 279 extern void owl_function_adminmsg(char *header, char *body); 268 280 extern void owl_function_make_outgoing_zephyr(char *body, char *zwriteline, char *zsig); 281 extern void owl_function_make_outgoing_aim(char *body, char *to); 269 282 extern void owl_function_zwrite_setup(char *line); 283 extern void owl_function_aimwrite_setup(char *line); 270 284 extern void owl_function_zcrypt_setup(char *line); 271 285 extern void owl_function_zwrite(char *line); 286 extern void owl_function_aimwrite(char *to); 272 287 extern void owl_function_nextmsg_full(char *filter, int skip_deleted, int last_if_none); 273 288 extern void owl_function_prevmsg_full(char *filter, int skip_deleted, int first_if_none); … … 586 601 extern void owl_message_curs_waddstr(owl_message *m, WINDOW *win, int aline, int bline, int acol, int bcol, int color); 587 602 extern int owl_message_is_personal(owl_message *m); 588 extern int owl_message_is_private(owl_message *m); 603 extern int owl_message_is_to_me(owl_message *m); 604 extern int owl_message_is_from_me(owl_message *m); 589 605 extern int owl_message_is_mail(owl_message *m); 590 606 extern int owl_message_is_ping(owl_message *m); … … 931 947 extern int owl_zwrite_is_personal(owl_zwrite *z); 932 948 extern void owl_zwrite_free(owl_zwrite *z); 949
Note: See TracChangeset
for help on using the changeset viewer.