summaryrefslogtreecommitdiffabout
path: root/korganizer/incomingdialog.cpp
Unidiff
Diffstat (limited to 'korganizer/incomingdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/incomingdialog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/incomingdialog.cpp b/korganizer/incomingdialog.cpp
index 490d21e..f3bd09f 100644
--- a/korganizer/incomingdialog.cpp
+++ b/korganizer/incomingdialog.cpp
@@ -431,97 +431,97 @@ bool IncomingDialog::incomeRequest(ScheduleItemIn *item)
431} 431}
432 432
433bool IncomingDialog::automaticAction(ScheduleItemIn *item) 433bool IncomingDialog::automaticAction(ScheduleItemIn *item)
434{ 434{
435 bool autoAction = false; 435 bool autoAction = false;
436 IncidenceBase *inc = item->event(); 436 IncidenceBase *inc = item->event();
437 Scheduler::Method method = item->method(); 437 Scheduler::Method method = item->method();
438 438
439 if( inc->type()=="FreeBusy" ) { 439 if( inc->type()=="FreeBusy" ) {
440 if ( method==Scheduler::Request ) { 440 if ( method==Scheduler::Request ) {
441 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) { 441 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) {
442 // reply freebusy information 442 // reply freebusy information
443 if ( checkOrganizerInAddressbook(inc->organizer()) ) { 443 if ( checkOrganizerInAddressbook(inc->organizer()) ) {
444 incomeRequest(item); 444 incomeRequest(item);
445 } 445 }
446 } else return false; 446 } else return false;
447 } else { 447 } else {
448 448
449 if ( method==Scheduler::Reply ) { 449 if ( method==Scheduler::Reply ) {
450 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) { 450 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) {
451 // insert freebusy information 451 // insert freebusy information
452 //if ( checkAttendeesInAddressbook(inc) ) 452 //if ( checkAttendeesInAddressbook(inc) )
453 453
454 } else return false; 454 } else return false;
455 } else { 455 } else {
456 if ( method==Scheduler::Publish) { 456 if ( method==Scheduler::Publish) {
457 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) { 457 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) {
458 // insert freebusy information 458 // insert freebusy information
459 //if ( checkOrganizerInAddressbook(inc->organizer()) ) 459 //if ( checkOrganizerInAddressbook(inc->organizer()) )
460 460
461 } 461 }
462 } else return false; 462 } else return false;
463 } 463 }
464 } 464 }
465 } 465 }
466 466
467 if ( inc->type()=="Event" ) { 467 if ( inc->type()=="Event" ) {
468 if ( method==Scheduler::Request || method==Scheduler::Publish ) { 468 if ( method==Scheduler::Request || method==Scheduler::Publish ) {
469 if ( KOPrefs::instance()->mIMIPAutoInsertRequest==KOPrefs::addressbookAuto ) { 469 if ( KOPrefs::instance()->mIMIPAutoInsertRequest==KOPrefs::addressbookAuto ) {
470 // insert event 470 // insert event
471 if ( checkOrganizerInAddressbook(inc->organizer()) ) 471 if ( checkOrganizerInAddressbook(inc->organizer()) )
472 autoAction = acceptMessage(item); 472 autoAction = acceptMessage(item);
473 } else return false; 473 } else return false;
474 } else { 474 } else {
475 475
476 if ( method==Scheduler::Reply ) { 476 if ( method==Scheduler::Reply ) {
477 if ( KOPrefs::instance()->mIMIPAutoInsertReply==KOPrefs::addressbookAuto ) { 477 if ( KOPrefs::instance()->mIMIPAutoInsertReply==KOPrefs::addressbookAuto ) {
478 // update event information 478 // update event information
479 if ( checkAttendeesInAddressbook(inc) ) 479 if ( checkAttendeesInAddressbook(inc) )
480 autoAction = acceptMessage(item); 480 autoAction = acceptMessage(item);
481 } else return false; 481 } else return false;
482 } else { 482 } else {
483 483
484 if ( method==Scheduler::Refresh ) { 484 if ( method==Scheduler::Refresh ) {
485 if ( KOPrefs::instance()->mIMIPAutoRefresh==KOPrefs::addressbookAuto ) { 485 if ( KOPrefs::instance()->mIMIPAutoRefresh==KOPrefs::addressbookAuto ) {
486 // send refresh-information 486 // send refresh-information
487 if ( checkAttendeesInAddressbook(inc) ) 487 if ( checkAttendeesInAddressbook(inc) )
488 autoAction = acceptMessage(item); 488 autoAction = acceptMessage(item);
489 else return false; 489 else return false;
490 } else return false; 490 } else return false;
491 } else return false; 491 } else return false;
492 } 492 }
493 } 493 }
494 } 494 }
495 return autoAction; 495 return autoAction;
496} 496}
497 497
498bool IncomingDialog::checkOrganizerInAddressbook(QString organizer) 498bool IncomingDialog::checkOrganizerInAddressbook(QString organizer)
499{ 499{
500 bool inBook = false; 500 bool inBook = false;
501#ifndef KORG_NOKABC 501#ifndef KORG_NOKABC
502 KABC::AddressBook *add_book = KABC::StdAddressBook::self(); 502 KABC::AddressBook *add_book = KABC::StdAddressBook::self();
503 KABC::Addressee::List addressList; 503 KABC::Addressee::List addressList;
504 addressList = add_book->findByEmail(organizer); 504 addressList = add_book->findByEmail(organizer);
505 if ( addressList.size()>0 ) inBook = true; 505 if ( addressList.size()>0 ) inBook = true;
506#endif 506#endif
507 return inBook; 507 return inBook;
508} 508}
509 509
510bool IncomingDialog::checkAttendeesInAddressbook(IncidenceBase *inc) 510bool IncomingDialog::checkAttendeesInAddressbook(IncidenceBase *inc)
511{ 511{
512 bool inBook = false; 512 bool inBook = false;
513#ifndef KORG_NOKABC 513#ifndef KORG_NOKABC
514 KABC::AddressBook *add_book = KABC::StdAddressBook::self(); 514 KABC::AddressBook *add_book = KABC::StdAddressBook::self();
515 KABC::Addressee::List addressList; 515 KABC::Addressee::List addressList;
516 QPtrList <Attendee> attendees; 516 QPtrList <Attendee> attendees;
517 Attendee *att; 517 Attendee *att;
518 attendees = inc->attendees(); 518 attendees = inc->attendees();
519 for (att=attendees.first();att;att=attendees.next()) { 519 for (att=attendees.first();att;att=attendees.next()) {
520 addressList = add_book->findByEmail(att->email()); 520 addressList = add_book->findByEmail(att->email());
521 if (addressList.size()>0 ) inBook = true; 521 if (addressList.size()>0 ) inBook = true;
522 } 522 }
523#endif 523#endif
524 return inBook; 524 return inBook;
525} 525}
526 526
527#include "incomingdialog.moc" 527//#include "incomingdialog.moc"