Skip to content

Commit

Permalink
Use "retrieve" rather than "recover" for past pubsub node content
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed Oct 16, 2010
1 parent 641f67f commit 2869b38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions TNPubSubNode.j
Expand Up @@ -125,10 +125,10 @@
#pragma mark -
#pragma mark Node Management

/*! recover the content of the PubSub node from the server and call _didRecoverPubSubNode selector
You should use this method to populate the content property
/*! retrieve the content of the PubSub node from the server and call _didRetrievePubSubNode selector
You should use this method to get past content
*/
- (void)recover
- (void)retrieveItems
{
var uid = [_connection getUniqueId],
stanza = [TNStropheStanza iq],
Expand All @@ -141,23 +141,23 @@
[stanza addChildWithName:@"pubsub" andAttributes:{@"xmlns": Strophe.NS.PUBSUB}];
[stanza addChildWithName:@"items" andAttributes:{@"node": _nodeName}];

[_connection registerSelector:@selector(_didRecoverPubSubNode:) ofObject:self withDict:params];
[_connection registerSelector:@selector(_didRetrievePubSubNode:) ofObject:self withDict:params];
[_connection send:stanza];
}

/*! send TNStrophePubSubNodeRecoveredNotification if everything is ok
/*! send TNStrophePubSubNodeRetrievedNotification if everything is ok
@param aStanza TNStropheStanza contaning the response of the server
@return NO in order to unregister the selector from connection
*/
- (BOOL)_didRecoverPubSubNode:(TNStropheStanza)aStanza
- (BOOL)_didRetrievePubSubNode:(TNStropheStanza)aStanza
{
if ([aStanza type] == @"result")
{
_content = [aStanza childrenWithName:@"item"];
[[CPNotificationCenter defaultCenter] postNotificationName:TNStrophePubSubNodeRecoveredNotification object:self];
[[CPNotificationCenter defaultCenter] postNotificationName:TNStrophePubSubNodeRetrievedNotification object:self];
}
else
CPLog.error("Cannot recover the pubsub node with name: " + _nodeName);
CPLog.error("Cannot retrieve the contents of pubsub node with name: " + _nodeName);

return NO;
}
Expand Down
2 changes: 1 addition & 1 deletion TNStropheGlobals.j
Expand Up @@ -276,7 +276,7 @@ TNStrophePubSubVarAccessModelWhitelist = @"whitelist";
@group TNPubSub
notification indicates that a pubsub node has been recovered
*/
TNStrophePubSubNodeRecoveredNotification = @"TNStrophePubSubNodeRecoveredNotification";
TNStrophePubSubNodeRetrievedNotification = @"TNStrophePubSubNodeRetrievedNotification";

/*!
@global
Expand Down

0 comments on commit 2869b38

Please sign in to comment.