mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 01:24:27 +02:00
Just some more centralised functionality
This commit is contained in:
parent
99f0746660
commit
d125939888
3 changed files with 17 additions and 11 deletions
|
@ -2532,6 +2532,20 @@ class diaspora {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Build the post xml
|
||||
*
|
||||
* @param string $type The message type
|
||||
* @param array $message The message data
|
||||
*
|
||||
* @return string The post XML
|
||||
*/
|
||||
public static function build_post_xml($type, $message) {
|
||||
|
||||
$data = array("XML" => array("post" => array($type => $message)));
|
||||
return xml::from_array($data, $xml);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Builds and transmit messages
|
||||
*
|
||||
|
@ -2547,9 +2561,7 @@ class diaspora {
|
|||
*/
|
||||
private function build_and_transmit($owner, $contact, $type, $message, $public_batch = false, $guid = "", $spool = false) {
|
||||
|
||||
$data = array("XML" => array("post" => array($type => $message)));
|
||||
|
||||
$msg = xml::from_array($data, $xml);
|
||||
$msg = build_post_xml($type, $message);
|
||||
|
||||
logger('message: '.$msg, LOGGER_DATA);
|
||||
logger('send guid '.$guid, LOGGER_DEBUG);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue