diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2009-10-20 22:39:00 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2009-10-20 22:39:00 +0200 |
commit | 4b3d1128bf96b96322e4b99da4633f44fa49e585 (patch) | |
tree | fa379e005e9db47cad073f57e8e6b1c4fb609b6c /main.c | |
parent | 27d37093ab87c2a1b8e846b4f4df83bf19ceba4c (diff) |
Parse kicks and store number of kicks and times kicked per user.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -119,6 +119,18 @@ int main(int argc, char **argv) { struct user_t *user = user_get(nick); continue; } + + rc = pcre_exec(rs->kick, rs->kick_e, line, strlen(line), 0, 0, ovector, 30); + if(rc > 0) { + char nick[NICK_BUFFER_SIZE], victim[NICK_BUFFER_SIZE]; + pcre_copy_named_substring(rs->kick, line, ovector, rc, "nick", nick, NICK_BUFFER_SIZE); + pcre_copy_named_substring(rs->kick, line, ovector, rc, "victim", victim, NICK_BUFFER_SIZE); + struct user_t *user = user_get(nick), + *victim_user = user_get(victim); + user->kicks++; + victim_user->kicked++; + continue; + } } fclose(f); |