XMPPHP_Log::LEVEL_VERBOSE : NULL
);
$conn->autoSubscribe();
-
+ $conn->useEncryption(common_config('xmpp', 'encryption'));
+
if (!$conn) {
return false;
}
if ($sub->find()) {
while ($sub->fetch()) {
$user = User::staticGet($sub->subscriber);
- if ($user && $user->jabber && $user->jabbernotify && !$sent_to[$user->id]) {
+ if ($user && $user->jabber && $user->jabbernotify && !array_key_exists($user->id,$sent_to)) {
common_log(LOG_INFO,
'Sending notice ' . $notice->id . ' to ' . $user->jabber,
__FILE__);
$public = common_config('xmpp', 'public');
# FIXME PRIV don't send out private messages here
+ # XXX: should we send out non-local messages if public,localonly = false? I think not
- if ($public) {
+ if ($public && $notice->is_local) {
foreach ($public as $address) {
common_log(LOG_INFO,
'Sending notice ' . $notice->id . ' to public listener ' . $address,