Skip to content

Commit

Permalink
removed ^M, need to fix my eclipse, else this is gonna be insane
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavsingh committed Jul 13, 2012
1 parent 11ff264 commit 341e3ba
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
POSSIBILITY OF SUCH DAMAGE.
98 changes: 49 additions & 49 deletions examples/publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,36 @@
* POSSIBILITY OF SUCH DAMAGE.
*
*/

if($argc < 3) {
echo "Usage: $argv[0] jid pass\n";
exit;
}

//
// initialize JAXL object with initial config
//
require_once 'jaxl.php';
$client = new JAXL(array(
'jid' => $argv[1],
'pass' => $argv[2]
));

$client->require_xep(array(
'0060' // Publish-Subscribe
));

//
// add necessary event callbacks here
//

$client->add_cb('on_auth_success', function() {
global $client;
_debug("got on_auth_success cb, jid ".$client->full_jid->to_string());

// create node
//$client->xeps['0060']->create_node('pubsub.localhost', 'dummy_node');


if($argc < 3) {
echo "Usage: $argv[0] jid pass\n";
exit;
}

//
// initialize JAXL object with initial config
//
require_once 'jaxl.php';
$client = new JAXL(array(
'jid' => $argv[1],
'pass' => $argv[2]
));

$client->require_xep(array(
'0060' // Publish-Subscribe
));

//
// add necessary event callbacks here
//

$client->add_cb('on_auth_success', function() {
global $client;
_debug("got on_auth_success cb, jid ".$client->full_jid->to_string());

// create node
//$client->xeps['0060']->create_node('pubsub.localhost', 'dummy_node');

// publish
$item = new JAXLXml('item', null);
$item->c('entry', 'http://www.w3.org/2005/Atom');
Expand All @@ -73,24 +73,24 @@
$item->c('link', null, array('rel'=>'alternate', 'type'=>'text/html', 'href'=>'http://denmark.lit/2003/12/13/atom03'))->up();
$item->c('id')->t('tag:denmark.lit,2003:entry-32397')->up();
$item->c('published')->t('2003-12-13T18:30:02Z')->up();
$item->c('updated')->t('2003-12-13T18:30:02Z')->up();
$client->xeps['0060']->publish_item('pubsub.localhost', 'dummy_node', $item);
});

$client->add_cb('on_auth_failure', function($reason) {
global $client;
$client->send_end_stream();
_debug("got on_auth_failure cb with reason $reason");
});

$client->add_cb('on_disconnect', function() {
_debug("got on_disconnect cb");
});

//
// finally start configured xmpp stream
//
$client->start();
$item->c('updated')->t('2003-12-13T18:30:02Z')->up();
$client->xeps['0060']->publish_item('pubsub.localhost', 'dummy_node', $item);
});

$client->add_cb('on_auth_failure', function($reason) {
global $client;
$client->send_end_stream();
_debug("got on_auth_failure cb with reason $reason");
});

$client->add_cb('on_disconnect', function() {
_debug("got on_disconnect cb");
});

//
// finally start configured xmpp stream
//
$client->start();
echo "done\n";

?>
?>
8 changes: 4 additions & 4 deletions examples/subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
*
*/

if($argc < 3) {
echo "Usage: $argv[0] jid pass\n";
exit;
if($argc < 3) {
echo "Usage: $argv[0] jid pass\n";
exit;
}

//
Expand Down Expand Up @@ -85,4 +85,4 @@
$client->start();
echo "done\n";

?>
?>
10 changes: 5 additions & 5 deletions xep/xep_0030.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ public function get_info($entity_jid, $callback=null) {
$this->jaxl->send($pkt);
}

public function get_items_pkt($entity_jid) {
return $this->jaxl->get_iq_pkt(
array('type'=>'get', 'from'=>$this->jaxl->full_jid->to_string(), 'to'=>$entity_jid),
new JAXLXml('iq', NS_DISCO_ITEMS)
);
public function get_items_pkt($entity_jid) {
return $this->jaxl->get_iq_pkt(
array('type'=>'get', 'from'=>$this->jaxl->full_jid->to_string(), 'to'=>$entity_jid),
new JAXLXml('iq', NS_DISCO_ITEMS)
);
}

public function get_items($entity_jid, $callback=null) {
Expand Down

0 comments on commit 341e3ba

Please sign in to comment.