@@ -43,13 +43,15 @@ public ItemDelete(BlockingQueue<Packet> outQueue,
4343 }
4444
4545 @ Override
46- public void process (Element elm , JID actorJID , IQ reqIQ , Element rsm )
46+ public void process (Element elm , JID actor , IQ reqIQ , Element rsm )
4747 throws InterruptedException , NodeStoreException {
4848
4949 element = elm ;
5050 request = reqIQ ;
5151 response = IQ .createResultIQ (request );
5252 node = element .attributeValue ("node" );
53+ this .actor = actor ;
54+ if (null == this .actor ) this .actor = request .getFrom ();
5355
5456 if (!channelManager .isLocalNode (node )) {
5557 makeRemoteRequest ();
@@ -146,15 +148,15 @@ private boolean canDelete() throws NodeStoreException {
146148 private boolean userOwnsItem () {
147149 try {
148150 return parsedPayload .element ("author" ).elementText ("name" )
149- .equals (request . getFrom () .toBareJID ());
151+ .equals (actor .toBareJID ());
150152 } catch (NullPointerException e ) {
151153 return false ;
152154 }
153155 }
154156
155157 private boolean userManagesNode () throws NodeStoreException {
156158 NodeAffiliation affiliation = channelManager .getUserAffiliation (node ,
157- new JID ( request . getFrom (). toBareJID ()) );
159+ actor );
158160 if (affiliation == null ) {
159161 return false ;
160162 }
@@ -240,10 +242,10 @@ private boolean validNodeProvided() {
240242
241243 private void makeRemoteRequest () throws InterruptedException {
242244 request .setTo (new JID (node .split ("/" )[2 ]).getDomain ());
243- Element actor = request .getElement ()
245+ request .getElement ()
244246 .element ("pubsub" )
245- .addElement ("actor" , JabberPubsub .NS_BUDDYCLOUD );
246- actor .addText (request . getFrom () .toBareJID ());
247+ .addElement ("actor" , JabberPubsub .NS_BUDDYCLOUD )
248+ .addText (actor .toBareJID ());
247249 outQueue .put (request );
248250 }
249251
0 commit comments