Patch to add handler when retrieving or modifying affiliations and susbscriptions
From: Didier Perrotey <Didier.Perrotey@xxxxxxxxxxxxxxxxx>
Date: Tue, 19 Feb 2008 17:47:48 +0100 (CET)
Hi,

I wonder if it's possible to integrate this patch into the current trunk
in order to be triggered when retrieving or modifying subscriptions and affilations of a pubsub node ?
I've tested it and it seems to work well :-)

Kind regards

   Didier

diff pubsubresulthandler.h pubsubresulthandler.new.h
208a209
>                                             const SubscriberList* list,
236a238
>                                            const AffiliateList* list,


diff pubsubmanager.cpp pubsubmanager.new.cpp
710c738
<                         rh->handleSubscribersResult( service, node );
---
>                         rh->handleSubscribersResult( service, node, 0);
713c741
<                         rh->handleAffiliatesResult( service, node );
---
>                         rh->handleAffiliatesResult( service, node, 0);
975a1016,1077
>             case GetAffiliateList:
>                 {
>                   const Tag* aff = query->findChild( "affiliations" );
>                 AffiliateList list;
>                   const TagList& affiliates = aff->children();
>                   TagList::const_iterator it = affiliates.begin();
>                   for( ; it != affiliates.end(); ++it )
>                   {
> const std::string& jid = (*it)->findAttribute( "jid" ); > const std::string& afft = (*it)->findAttribute( "affiliation" ); > list.push_back( Affiliate( jid, affiliationType( afft ) ) );
>                   }
> rh->handleAffiliates( service, aff->findAttribute( "node" ), &list, error);
>                   break;
>                 }
>             case SetAffiliateList:
>                 {
>                   const Tag* aff = query->findChild( "affiliations" );
>                 AffiliateList list;
>                   const TagList& affiliates = aff->children();
>                   TagList::const_iterator it = affiliates.begin();
>                   for( ; it != affiliates.end(); ++it )
>                   {
> const std::string& jid = (*it)->findAttribute( "jid" ); > const std::string& afft = (*it)->findAttribute( "affiliation" ); > list.push_back( Affiliate( jid, affiliationType( afft ) ) );
>                   }
> rh->handleAffiliatesResult( service, aff->findAttribute( "node" ), &list, error);
>                   break;
>                 }
>           case GetSubscriberList:
>                 {
>                   const Tag* subt = query->findChild( "subscriptions" );
>                   SubscriberList list;
>                   const TagList& subs = subt->children();
>                   TagList::const_iterator it = subs.begin();
>                   for( ; it != subs.end(); ++it )
>                   {
> const std::string& jid = (*it)->findAttribute( "jid" ); > const std::string& sub = (*it)->findAttribute( "subscription" ); > const std::string& subid = (*it)->findAttribute( "subid" ); > list.push_back( Subscriber( jid, subscriptionType( sub ), subid ) );
>                   }
> rh->handleSubscribers( service, subt->findAttribute( "node" ), &list, error);
>                   break;
>                 }
>             case SetSubscriberList:
>                 {
>                   const Tag* subt = query->findChild( "subscriptions" );
>                   SubscriberList list;
>                   const TagList& subs = subt->children();
>                   TagList::const_iterator it = subs.begin();
>                   for( ; it != subs.end(); ++it )
>                   {
> const std::string& jid = (*it)->findAttribute( "jid" ); > const std::string& sub = (*it)->findAttribute( "subscription" ); > const std::string& subid = (*it)->findAttribute( "subid" ); > list.push_back( Subscriber( jid, subscriptionType( sub ), subid ) );
>                   }
> rh->handleSubscribersResult( service, subt->findAttribute( "node" ), &list, error);
>                   break;
>                 }