26 |
#include "user_iface.h" |
#include "user_iface.h" |
27 |
#include "demux.h" |
#include "demux.h" |
28 |
#include "misc.h" |
#include "misc.h" |
29 |
|
#include "log.h" |
30 |
|
|
31 |
/* Header of sent and received messages. */ |
/* Header of sent and received messages. */ |
32 |
/* ATTENTION: Changing this struct requires revision of hton_header(), |
/* ATTENTION: Changing this struct requires revision of hton_header(), |
79 |
void |
void |
80 |
pr_send_text (contact_t *contact, const char *txt) |
pr_send_text (contact_t *contact, const char *txt) |
81 |
{ |
{ |
82 |
|
size_t len = strlen (txt); |
83 |
|
|
84 |
header.type = MSG_TEXT; |
header.type = MSG_TEXT; |
85 |
hton_header (); |
hton_header (); |
86 |
tr_send_msg (contact, (BYTE *)&header, HEADER_SIZE(text), |
tr_send_msg (contact, (BYTE *)&header, HEADER_SIZE(text), |
87 |
(BYTE *)txt, strlen (txt)); |
(BYTE *)txt, len); |
88 |
|
|
89 |
|
if (cfg.logging) { |
90 |
|
lg_log_text (cfg.nick, contact, txt, len); |
91 |
|
} |
92 |
} |
} |
93 |
|
|
94 |
void |
void |
260 |
|
|
261 |
ui_output_msg (contact, text, len); |
ui_output_msg (contact, text, len); |
262 |
|
|
263 |
|
if (cfg.logging) { |
264 |
|
lg_log_text (contact->nick, contact, text, len); |
265 |
|
} |
266 |
|
|
267 |
return OK; |
return OK; |
268 |
} |
} |
269 |
|
|