I'm trying to update the kopete-antispam plugin so that it rejects all 
messages not from existing contacts, without questions, and also 
automatically deletes all contacts that are put into the temporary 
contacts group.

I tried this code to delete a contact, but it didn't compile and I'm 
sure I'm not using the right APIs:

          if ( !msg.from() || !msg.from()->metaContact() || 
       msg.from()->metaContact()->isTemporary() ) {
                msg.from().deleteContact();
           }

I get a few compilation errors, below, but what I'd really like is a 
pointer to the right classes and functions to use - then I can figure 
out what to do:

kopeteantispamplugin.cpp: In member function 'void 
KopeteAntispamPlugin::onMessageReceive(Kopete::Message&)':
kopeteantispamplugin.cpp:128: error: request for member 'deleteContact' 
in '((Kopete::Message*)msg)->Kopete::Message::from()', which is of 
non-class type 'const Kopete::Contact*'
make: *** [kopeteantispamplugin.lo] Error 1

I'm sure this is not too hard to do, and I know you don't support 
plugins themselves, but a quick pointer would be much appreciated as the 
actual code will be very simple I'm sure.

BTW this is mostly for an elderly relative, for whom Kopete is much 
better than Pidgin, but who finds deleting these spam contacts a pain.

Thanks in advance,

Richard



_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to