mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Added logging of unread messages to test
This commit is contained in:
parent
4662f21cb4
commit
78e4524de0
@ -25,6 +25,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
#include "chat_log.h"
|
#include "chat_log.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
@ -39,6 +41,8 @@ static log_level_t _get_log_level(char *log_level);
|
|||||||
gboolean _process_input(char *inp);
|
gboolean _process_input(char *inp);
|
||||||
static void _create_config_directory();
|
static void _create_config_directory();
|
||||||
|
|
||||||
|
static gdouble unread_period = 5;
|
||||||
|
|
||||||
void
|
void
|
||||||
profanity_run(void)
|
profanity_run(void)
|
||||||
{
|
{
|
||||||
@ -47,12 +51,23 @@ profanity_run(void)
|
|||||||
log_info("Starting main event loop");
|
log_info("Starting main event loop");
|
||||||
|
|
||||||
inp_non_block();
|
inp_non_block();
|
||||||
|
|
||||||
|
GTimer *timer = g_timer_new();
|
||||||
|
|
||||||
while(cmd_result == TRUE) {
|
while(cmd_result == TRUE) {
|
||||||
int ch = ERR;
|
int ch = ERR;
|
||||||
char inp[INP_WIN_MAX];
|
char inp[INP_WIN_MAX];
|
||||||
int size = 0;
|
int size = 0;
|
||||||
|
|
||||||
while(ch != '\n') {
|
while(ch != '\n') {
|
||||||
|
|
||||||
|
gdouble elapsed = g_timer_elapsed(timer, NULL);
|
||||||
|
|
||||||
|
if (elapsed >= unread_period) {
|
||||||
|
log_info("Unread : %d", win_get_unread());
|
||||||
|
g_timer_start(timer);
|
||||||
|
}
|
||||||
|
|
||||||
win_handle_special_keys(&ch);
|
win_handle_special_keys(&ch);
|
||||||
|
|
||||||
if (ch == KEY_RESIZE) {
|
if (ch == KEY_RESIZE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user