diff options
author | ache <ache@ache.one> | 2019-02-10 23:31:44 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2019-02-10 23:31:44 +0100 |
commit | 10959bf8d4b034173b818e86ca2ed3530e29df78 (patch) | |
tree | 0a33a85ca27be90191814a4273c3f46d9c8dd855 /main.c | |
parent | Refesh from inotify (fuck yeah !) (diff) |
Manage new message
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -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 ) { |