Mercurial > pidgin.yaz
comparison src/protocols/irc/irc.c @ 9740:2bb5e2cd64bd
[gaim-migrate @ 10605]
" A few days back, someone on #gaim was wondering how to
block IM's from IRC, which isn't supported by gaim, as
this isn't supported at a protocol level. I decided to
implement gaim's privacy options (permit lists, deny
lists, block all users, and permit people on buddy
list) at a local level for IRC and
Zephyr. Jabber, SILC, and Trepia don't seem to support
deny or permit lists in Gaim, but I don't use the
latter two protocols and wasn't sure about how to
implemnt in in Jabber.
When implementing it, I noticed that changes in privacy
settings didn't automatically cause blist.xml to get
scheduled
for writing (even on exit). To fix this, I needed to
make schedule_blist_save in blist.c non-static and call
it from serv_set_permit_deny() in server.c, and
gaim_privacy_{permit,deny}_{add,remove} in privacy.c ." --Arun A Tharuvai
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Wed, 11 Aug 2004 23:52:48 +0000 |
parents | db62420a53a2 |
children | b10d4c6ac7eb |
comparison
equal
deleted
inserted
replaced
9739:35f22ba01bd7 | 9740:2bb5e2cd64bd |
---|---|
31 #include "debug.h" | 31 #include "debug.h" |
32 #include "notify.h" | 32 #include "notify.h" |
33 #include "prpl.h" | 33 #include "prpl.h" |
34 #include "plugin.h" | 34 #include "plugin.h" |
35 #include "util.h" | 35 #include "util.h" |
36 #include "privacy.h" | |
36 | 37 |
37 #include "irc.h" | 38 #include "irc.h" |
38 | 39 |
39 static void irc_buddy_append(char *name, struct irc_buddy *ib, GString *string); | 40 static void irc_buddy_append(char *name, struct irc_buddy *ib, GString *string); |
40 | 41 |
327 { | 328 { |
328 struct irc_conn *irc = gc->proto_data; | 329 struct irc_conn *irc = gc->proto_data; |
329 const char *args[1]; | 330 const char *args[1]; |
330 args[0] = who; | 331 args[0] = who; |
331 irc_cmd_whois(irc, "whois", NULL, args); | 332 irc_cmd_whois(irc, "whois", NULL, args); |
333 } | |
334 | |
335 static void irc_add_deny(GaimConnection *gc, const char *who) | |
336 { | |
337 gaim_privacy_deny_add(gc->account,who,1); | |
338 } | |
339 | |
340 static void irc_rem_deny(GaimConnection *gc, const char *who) | |
341 { | |
342 gaim_privacy_deny_remove(gc->account,who,1); | |
343 } | |
344 | |
345 static void | |
346 irc_add_permit(GaimConnection *gc, const char *who) | |
347 { | |
348 gaim_privacy_permit_add(gc->account,who,1); | |
349 } | |
350 | |
351 static void | |
352 irc_rem_permit(GaimConnection *gc, const char *who) | |
353 { | |
354 gaim_privacy_permit_remove(gc->account,who,1); | |
355 } | |
356 | |
357 static void | |
358 irc_set_permit_deny(GaimConnection *gc) | |
359 { | |
360 /* This only has to exist */ | |
361 return; | |
332 } | 362 } |
333 | 363 |
334 static void irc_set_away(GaimConnection *gc, const char *state, const char *msg) | 364 static void irc_set_away(GaimConnection *gc, const char *state, const char *msg) |
335 { | 365 { |
336 struct irc_conn *irc = gc->proto_data; | 366 struct irc_conn *irc = gc->proto_data; |
590 NULL, /* change_passwd */ | 620 NULL, /* change_passwd */ |
591 irc_add_buddy, /* add_buddy */ | 621 irc_add_buddy, /* add_buddy */ |
592 NULL, /* add_buddies */ | 622 NULL, /* add_buddies */ |
593 irc_remove_buddy, /* remove_buddy */ | 623 irc_remove_buddy, /* remove_buddy */ |
594 NULL, /* remove_buddies */ | 624 NULL, /* remove_buddies */ |
595 NULL, /* add_permit */ | 625 irc_add_permit, /* add_permit */ |
596 NULL, /* add_deny */ | 626 irc_add_deny, /* add_deny */ |
597 NULL, /* rem_permit */ | 627 irc_rem_permit, /* rem_permit */ |
598 NULL, /* rem_deny */ | 628 irc_rem_deny, /* rem_deny */ |
599 NULL, /* set_permit_deny */ | 629 irc_set_permit_deny, /* set_permit_deny */ |
600 NULL, /* warn */ | 630 NULL, /* warn */ |
601 irc_chat_join, /* join_chat */ | 631 irc_chat_join, /* join_chat */ |
602 NULL, /* reject_chat */ | 632 NULL, /* reject_chat */ |
603 irc_chat_invite, /* chat_invite */ | 633 irc_chat_invite, /* chat_invite */ |
604 irc_chat_leave, /* chat_leave */ | 634 irc_chat_leave, /* chat_leave */ |