From 10959bf8d4b034173b818e86ca2ed3530e29df78 Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 10 Feb 2019 23:31:44 +0100 Subject: Manage new message --- main.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 77981eb..810ff65 100644 --- a/main.c +++ b/main.c @@ -217,9 +217,6 @@ int main(int argc, char* argv[]){ int ret = read( fd, buffer, EVENT_BUF_LEN ); int i = 0; while( ret > 0 ) { -#ifdef DEBUG - fprintf(stderr, "%d\n", ret); -#endif struct inotify_event *event = (struct inotify_event*) (buffer+i); ret -= EVENT_SIZE + event->len; i += EVENT_SIZE + event->len; @@ -229,15 +226,16 @@ int main(int argc, char* argv[]){ #endif if( strncmp(event->name, "IN", 2) == 0 ) { sprintf(sms_filename, "%s%s", config.SMS_INBOX, event->name); - fprintf(stderr, "%s\n", sms_filename); - readSMS(sms_filename, 0); + readSMS(sms_filename, SMS_IN, SMS_UNREAD); } else { sprintf(sms_filename, "%s%s", config.SMS_SENTBOX, event->name); - fprintf(stderr, "%s\n", sms_filename); - readSMS(sms_filename, 1); + readSMS(sms_filename, SMS_OUT, SMS_UNREAD); } } } + if( i > 0 ) { + showContactListW(); + } if (c == KEY_RESIZE) { resize(); @@ -422,8 +420,7 @@ edit: } } - - } + } // inotify stuff if( wd_in >= 0 ) { -- cgit v1.2.3