=== modified file 'irc_channel.c'
|
|
|
|
| 786 | 786 | { |
| 787 | 787 | struct irc_control_channel *icc = ic->data; |
| 788 | 788 | gboolean ret = FALSE; |
| | 789 | |
| | 790 | if(!strcmp(ic->name,"&friends")) { |
| | 791 | static const char filename[] = "/home/antoine/.bitlbee_friends"; |
| | 792 | FILE *file = fopen ( filename, "r" ); |
| | 793 | if ( file != NULL ) |
| | 794 | { |
| | 795 | char line [ 128 ]; /* or other suitable maximum line size */ |
| | 796 | |
| | 797 | while ( fgets ( line, sizeof line, file ) != NULL ) |
| | 798 | { |
| | 799 | if (line[strlen(line) - 1] == '\n') |
| | 800 | line[strlen(line) - 1] = '\0'; |
| | 801 | |
| | 802 | if(!strncmp(iu->nick,line,sizeof line)) |
| | 803 | { |
| | 804 | return TRUE; |
| | 805 | } |
| | 806 | } |
| | 807 | fclose ( file ); |
| | 808 | } |
| | 809 | return FALSE; |
| | 810 | } |
| | 811 | |
| 789 | 812 | |
| 790 | 813 | if( iu->bu == NULL ) |
| 791 | 814 | return FALSE; |