]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/jabber.php
add SUP links to RSS and Atom, too
[quix0rs-gnu-social.git] / lib / jabber.php
index a9643f4a67ea28ee6c4a68d3d1dbb562d93405fd..3d388bd01dbed13ca1fac68d03a484bb95b280d0 100644 (file)
@@ -92,6 +92,7 @@ function jabber_send_notice($to, $notice) {
        $msg = jabber_format_notice($profile, $notice);
        $entry = jabber_format_entry($profile, $notice);
        $conn->message($to, $msg, 'chat', NULL, $entry);
+       $profile->free();
        return true;
 }
 
@@ -122,7 +123,7 @@ function jabber_format_entry($profile, $notice) {
 
        $html = "\n<html xmlns='http://jabber.org/protocol/xhtml-im'>\n";
        $html .= "<body xmlns='http://www.w3.org/1999/xhtml'>\n";
-       $html .= "<a href='".common_profile_url($profile->nickname)."'>".$profile->nickname."</a>: ";
+       $html .= "<a href='".htmlspecialchars($profile->profileurl)."'>".$profile->nickname."</a>: ";
        $html .= ($notice->rendered) ? $notice->rendered : common_render_content($notice->content, $notice);
        $html .= "\n</body>\n";
        $html .= "\n</html>\n";
@@ -204,6 +205,9 @@ function jabber_broadcast_notice($notice) {
        $msg = jabber_format_notice($profile, $notice);
        $entry = jabber_format_entry($profile, $notice);
 
+       $profile->free();
+       unset($profile);
+       
        $sent_to = array();
        $conn = jabber_connect();
 
@@ -225,6 +229,8 @@ function jabber_broadcast_notice($notice) {
                $sent_to[$user->id] = 1;
        }
 
+       $user->free();
+       
     # Now, get users subscribed to this profile
 
        $user = new User();
@@ -245,6 +251,8 @@ function jabber_broadcast_notice($notice) {
                }
        }
 
+       $user->free();
+       
        return true;
 }
 
@@ -280,6 +288,7 @@ function jabber_public_notice($notice) {
                        $conn->message($address, $msg, 'chat', NULL, $entry);
                        $conn->processTime(0);
                }
+               $profile->free();
        }
 
        return true;