Skip to content

Commit 341e3ba

Browse files
committed
removed ^M, need to fix my eclipse, else this is gonna be insane
1 parent 11ff264 commit 341e3ba

File tree

4 files changed

+59
-59
lines changed

4 files changed

+59
-59
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
3030
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC
3131
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
3232
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33-
POSSIBILITY OF SUCH DAMAGE.
33+
POSSIBILITY OF SUCH DAMAGE.

examples/publisher.php

+49-49
Original file line numberDiff line numberDiff line change
@@ -35,36 +35,36 @@
3535
* POSSIBILITY OF SUCH DAMAGE.
3636
*
3737
*/
38-
39-
if($argc < 3) {
40-
echo "Usage: $argv[0] jid pass\n";
41-
exit;
42-
}
43-
44-
//
45-
// initialize JAXL object with initial config
46-
//
47-
require_once 'jaxl.php';
48-
$client = new JAXL(array(
49-
'jid' => $argv[1],
50-
'pass' => $argv[2]
51-
));
52-
53-
$client->require_xep(array(
54-
'0060' // Publish-Subscribe
55-
));
56-
57-
//
58-
// add necessary event callbacks here
59-
//
60-
61-
$client->add_cb('on_auth_success', function() {
62-
global $client;
63-
_debug("got on_auth_success cb, jid ".$client->full_jid->to_string());
64-
65-
// create node
66-
//$client->xeps['0060']->create_node('pubsub.localhost', 'dummy_node');
67-
38+
39+
if($argc < 3) {
40+
echo "Usage: $argv[0] jid pass\n";
41+
exit;
42+
}
43+
44+
//
45+
// initialize JAXL object with initial config
46+
//
47+
require_once 'jaxl.php';
48+
$client = new JAXL(array(
49+
'jid' => $argv[1],
50+
'pass' => $argv[2]
51+
));
52+
53+
$client->require_xep(array(
54+
'0060' // Publish-Subscribe
55+
));
56+
57+
//
58+
// add necessary event callbacks here
59+
//
60+
61+
$client->add_cb('on_auth_success', function() {
62+
global $client;
63+
_debug("got on_auth_success cb, jid ".$client->full_jid->to_string());
64+
65+
// create node
66+
//$client->xeps['0060']->create_node('pubsub.localhost', 'dummy_node');
67+
6868
// publish
6969
$item = new JAXLXml('item', null);
7070
$item->c('entry', 'http://www.w3.org/2005/Atom');
@@ -73,24 +73,24 @@
7373
$item->c('link', null, array('rel'=>'alternate', 'type'=>'text/html', 'href'=>'http://denmark.lit/2003/12/13/atom03'))->up();
7474
$item->c('id')->t('tag:denmark.lit,2003:entry-32397')->up();
7575
$item->c('published')->t('2003-12-13T18:30:02Z')->up();
76-
$item->c('updated')->t('2003-12-13T18:30:02Z')->up();
77-
$client->xeps['0060']->publish_item('pubsub.localhost', 'dummy_node', $item);
78-
});
79-
80-
$client->add_cb('on_auth_failure', function($reason) {
81-
global $client;
82-
$client->send_end_stream();
83-
_debug("got on_auth_failure cb with reason $reason");
84-
});
85-
86-
$client->add_cb('on_disconnect', function() {
87-
_debug("got on_disconnect cb");
88-
});
89-
90-
//
91-
// finally start configured xmpp stream
92-
//
93-
$client->start();
76+
$item->c('updated')->t('2003-12-13T18:30:02Z')->up();
77+
$client->xeps['0060']->publish_item('pubsub.localhost', 'dummy_node', $item);
78+
});
79+
80+
$client->add_cb('on_auth_failure', function($reason) {
81+
global $client;
82+
$client->send_end_stream();
83+
_debug("got on_auth_failure cb with reason $reason");
84+
});
85+
86+
$client->add_cb('on_disconnect', function() {
87+
_debug("got on_disconnect cb");
88+
});
89+
90+
//
91+
// finally start configured xmpp stream
92+
//
93+
$client->start();
9494
echo "done\n";
9595

96-
?>
96+
?>

examples/subscriber.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
*
3737
*/
3838

39-
if($argc < 3) {
40-
echo "Usage: $argv[0] jid pass\n";
41-
exit;
39+
if($argc < 3) {
40+
echo "Usage: $argv[0] jid pass\n";
41+
exit;
4242
}
4343

4444
//
@@ -85,4 +85,4 @@
8585
$client->start();
8686
echo "done\n";
8787

88-
?>
88+
?>

xep/xep_0030.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ public function get_info($entity_jid, $callback=null) {
7070
$this->jaxl->send($pkt);
7171
}
7272

73-
public function get_items_pkt($entity_jid) {
74-
return $this->jaxl->get_iq_pkt(
75-
array('type'=>'get', 'from'=>$this->jaxl->full_jid->to_string(), 'to'=>$entity_jid),
76-
new JAXLXml('iq', NS_DISCO_ITEMS)
77-
);
73+
public function get_items_pkt($entity_jid) {
74+
return $this->jaxl->get_iq_pkt(
75+
array('type'=>'get', 'from'=>$this->jaxl->full_jid->to_string(), 'to'=>$entity_jid),
76+
new JAXLXml('iq', NS_DISCO_ITEMS)
77+
);
7878
}
7979

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

0 commit comments

Comments
 (0)