mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
e6147fb8f2
This commit adds handling of long IRC messages to the core. In contrast to the `splitlong.pl' plugin, multi-byte encoded and recoded messages are properly split. To allow for this, a new function has been added to the server struct: `split_message'. `split_message' returns a string array with the message splitted to substrings of a length that the server can handle. If a protocol module doesn't have any limit, it can simply return a singleton array with a copy of the message. The `MSG' chat command now calls `split_message' before `send_message', and emits `message own_public' / `message own_private' with each substring, so that the string splitting will be visible in the UI. `split_message' in the IRC module uses `recode_split' which in turn uses iconv to properly split multi-byte encoded (and recoded) messages.
16 lines
485 B
C
16 lines
485 B
C
#ifndef __RECODE_H
|
|
#define __RECODE_H
|
|
|
|
char *recode_in (const SERVER_REC *server, const char *str, const char *target);
|
|
char *recode_out (const SERVER_REC *server, const char *str, const char *target);
|
|
char **recode_split(const SERVER_REC *server, const char *str,
|
|
const char *target, int len);
|
|
gboolean is_valid_charset(const char *charset);
|
|
gboolean is_utf8(void);
|
|
void recode_update_charset(void);
|
|
|
|
void recode_init (void);
|
|
void recode_deinit (void);
|
|
|
|
#endif /* __RECODE_H */
|