aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/notification/method/jabber.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-07-13 22:47:41 -0700
committerNathan Guse <nathaniel.guse@gmail.com>2013-07-13 22:47:41 -0700
commit1e37d97909ccf52b08e2a809ea8a9365c824d8de (patch)
treea260c846cb47713e72de11cfb9803d981ea6faaf /phpBB/phpbb/notification/method/jabber.php
parent4186c05bb4b97374392031a10b796e77b857afaf (diff)
parent7030578bbe9e11c18b5becaf8b06e670e3c2e3cd (diff)
downloadforums-1e37d97909ccf52b08e2a809ea8a9365c824d8de.tar
forums-1e37d97909ccf52b08e2a809ea8a9365c824d8de.tar.gz
forums-1e37d97909ccf52b08e2a809ea8a9365c824d8de.tar.bz2
forums-1e37d97909ccf52b08e2a809ea8a9365c824d8de.tar.xz
forums-1e37d97909ccf52b08e2a809ea8a9365c824d8de.zip
Merge pull request #1559 from naderman/ticket/11698
[WIP][ticket/11698] Moving all autoloadable files to phpbb/
Diffstat (limited to 'phpBB/phpbb/notification/method/jabber.php')
-rw-r--r--phpBB/phpbb/notification/method/jabber.php69
1 files changed, 69 insertions, 0 deletions
diff --git a/phpBB/phpbb/notification/method/jabber.php b/phpBB/phpbb/notification/method/jabber.php
new file mode 100644
index 0000000000..d3b756d020
--- /dev/null
+++ b/phpBB/phpbb/notification/method/jabber.php
@@ -0,0 +1,69 @@
+<?php
+/**
+*
+* @package notifications
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Jabber notification method class
+* This class handles sending Jabber messages for notifications
+*
+* @package notifications
+*/
+class phpbb_notification_method_jabber extends phpbb_notification_method_messenger_base
+{
+ /**
+ * Get notification method name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'jabber';
+ }
+
+ /**
+ * Is this method available for the user?
+ * This is checked on the notifications options
+ */
+ public function is_available()
+ {
+ return ($this->global_available() && $this->user->data['user_jabber']);
+ }
+
+ /**
+ * Is this method available at all?
+ * This is checked before notifications are sent
+ */
+ public function global_available()
+ {
+ return !(
+ empty($this->config['jab_enable']) ||
+ empty($this->config['jab_host']) ||
+ empty($this->config['jab_username']) ||
+ empty($this->config['jab_password']) ||
+ !@extension_loaded('xml')
+ );
+ }
+
+ public function notify()
+ {
+ if (!$this->global_available())
+ {
+ return;
+ }
+
+ return $this->notify_using_messenger(NOTIFY_IM, 'short/');
+ }
+}