1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-04 20:36:45 +02:00

implement chat logging

This commit is contained in:
Jfreegman
2014-02-26 01:51:06 -05:00
parent b6613a015f
commit 831d8e5f24
5 changed files with 159 additions and 3 deletions

View File

@ -131,6 +131,16 @@ struct StatusBar {
bool is_online;
};
#define MAX_LOG_BUF_LINES 10 /* write log_buf contents to log file after this many lines */
#define MAX_LOG_LINE_SIZE MAX_STR_SIZE + TOXIC_MAX_NAME_LENGTH + 24 /* extra room for time/date */
struct chatlog {
uint8_t log_path[MAX_STR_SIZE];
uint8_t log_buf[MAX_LOG_BUF_LINES][MAX_LOG_LINE_SIZE];
int pos;
bool log_on;
};
#define MAX_LINE_HIST 128
/* chat and groupchat window/buffer holder */
@ -145,6 +155,8 @@ struct ChatContext {
bool self_is_typing;
struct chatlog log;
WINDOW *history;
WINDOW *linewin;
WINDOW *sidebar;