build stanza ourselves, without library
darcs-hash:20080715033711-84dde-f4a4583d8182dc18fec6f7ea7e2e27ff4958cb90.gz
This commit is contained in:
		| @@ -86,11 +86,28 @@ function jabber_send_notice($to, $notice) { | |||||||
| 	} | 	} | ||||||
| 	$msg = jabber_format_notice($profile, $notice); | 	$msg = jabber_format_notice($profile, $notice); | ||||||
| 	$entry = jabber_format_entry($profile, $notice); | 	$entry = jabber_format_entry($profile, $notice); | ||||||
| 	common_log(LOG_DEBUG, 'special entry = ' . $entry, __FILE__); | 	$stanza = jabber_make_stanza($to, $msg, 'chat', NULL, $entry); | ||||||
| 	$conn->message($to, $msg, 'chat', NULL, $entry); | 	common_log(LOG_DEBUG, 'full stanza = ' . $stanza, __FILE__); | ||||||
|  | 	$conn->send($stanza); | ||||||
| 	return true; | 	return true; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function jabber_make_stanza($to, $body, $type = 'chat', $subject = null, $payload = null) { | ||||||
|  | 	$to	  = htmlspecialchars($to); | ||||||
|  | 	$body	= htmlspecialchars($body); | ||||||
|  | 	$subject = htmlspecialchars($subject); | ||||||
|  |  | ||||||
|  | 	$jid = jabber_daemon_address(); | ||||||
|  | 	 | ||||||
|  | 	$out = "<message from='$jid' to='$to' type='$type'>"; | ||||||
|  | 	if($subject) $out .= "<subject>$subject</subject>"; | ||||||
|  | 	$out .= "<body>$body</body>"; | ||||||
|  | 	if($payload) $out .= $payload; | ||||||
|  | 	$out .= "</message>"; | ||||||
|  | 	 | ||||||
|  | 	return $out; | ||||||
|  | } | ||||||
|  |  | ||||||
| # Extra stuff defined by Twitter, needed by twitter clients | # Extra stuff defined by Twitter, needed by twitter clients | ||||||
|  |  | ||||||
| function jabber_format_entry($profile, $notice) { | function jabber_format_entry($profile, $notice) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user