* fixed cli vcard example

git-svn-id: svn://netflint.net/xmpphp@72 ef36c318-a008-4979-b6e8-6b496270793b
This commit is contained in:
fritzy 2008-11-28 20:15:36 +00:00
parent eaf949de88
commit 27b3729c8e

View File

@ -15,7 +15,7 @@ $vcard_request = array();
try { try {
$conn->connect(); $conn->connect();
while(!$conn->isDisconnected()) { while(!$conn->isDisconnected()) {
$payloads = $conn->processUntil(array('message', 'presence', 'end_stream', 'session_start')); $payloads = $conn->processUntil(array('message', 'presence', 'end_stream', 'session_start', 'vcard'));
foreach($payloads as $event) { foreach($payloads as $event) {
$pl = $event[1]; $pl = $event[1];
switch($event[0]) { switch($event[0]) {
@ -26,6 +26,7 @@ try {
print $pl['body'] . "\n"; print $pl['body'] . "\n";
print "---------------------------------------------------------------------------------\n"; print "---------------------------------------------------------------------------------\n";
$conn->message($pl['from'], $body="Thanks for sending me \"{$pl['body']}\".", $type=$pl['type']); $conn->message($pl['from'], $body="Thanks for sending me \"{$pl['body']}\".", $type=$pl['type']);
$cmd = explode(' ', $pl['body']);
if($cmd[0] == 'quit') $conn->disconnect(); if($cmd[0] == 'quit') $conn->disconnect();
if($cmd[0] == 'break') $conn->send("</end>"); if($cmd[0] == 'break') $conn->send("</end>");
if($cmd[0] == 'vcard') { if($cmd[0] == 'vcard') {