Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import "PingAdiumPlugin.h"
- @implementation PingAdiumPlugin
- - (void)installPlugin {
- [[adium contentController] registerContentFilter:self ofType:AIFilterContent direction:AIFilterIncoming];
- }
- - (void)uninstallPlugin {
- [[adium contentController] unregisterContentFilter:self];
- }
- - (NSAttributedString *)filterAttributedString:(NSAttributedString *)inAttributedString context:(id)context {
- if ([[inAttributedString string] isEqual:@"ping"]) {
- AIContentMessage *msg = context;
- AIContentMessage *message = [[AIContentMessage alloc]
- initWithChat:[msg chat]
- source:[msg destination]
- destination:[msg source]
- date:[msg date]
- message:@"pong"];
- [msg sendMessageObject:message];
- [message release];
- }
- return inAttributedString;
- }
- - (float)filterPriority {
- return DEFAULT_FILTER_PRIORITY;
- }
- @end
Add Comment
Please, Sign In to add comment