[55568] trunk/dports/net/psi
rowue at macports.org
rowue at macports.org
Thu Aug 13 09:16:46 PDT 2009
Revision: 55568
http://trac.macports.org/changeset/55568
Author: rowue at macports.org
Date: 2009-08-13 09:16:45 -0700 (Thu, 13 Aug 2009)
Log Message:
-----------
reenabled plugin system
Modified Paths:
--------------
trunk/dports/net/psi/Portfile
trunk/dports/net/psi/files/patch-src-src.pro.diff
Added Paths:
-----------
trunk/dports/net/psi/files/patch-configure.diff
trunk/dports/net/psi/files/patch-src-applicationinfo.cpp.diff
trunk/dports/net/psi/files/patch-src-pluginhost.cpp.diff
trunk/dports/net/psi/files/patch-src-pluginhost.h.diff
trunk/dports/net/psi/files/patch-src-pluginmanager.cpp.diff
trunk/dports/net/psi/files/patch-src-pluginmanager.h.diff
trunk/dports/net/psi/files/patch-src-plugins-include-eventfilter.h.diff
trunk/dports/net/psi/files/patch-src-plugins-include-iqfilter.h.diff
trunk/dports/net/psi/files/patch-src-plugins-include-psiplugin.h.diff
trunk/dports/net/psi/files/patch-src-plugins-include-stanzasender.h.diff
trunk/dports/net/psi/files/patch-src-psiaccount.cpp.diff
trunk/dports/net/psi/files/patch-src-psichatdlg.cpp.diff
trunk/dports/net/psi/files/patch-src-psichatdlg.h.diff
Modified: trunk/dports/net/psi/Portfile
===================================================================
--- trunk/dports/net/psi/Portfile 2009-08-13 15:47:01 UTC (rev 55567)
+++ trunk/dports/net/psi/Portfile 2009-08-13 16:16:45 UTC (rev 55568)
@@ -5,6 +5,7 @@
name psi
version 0.13
+revision 1
categories net chat
maintainers rowue
description jabber-based instant messaging client
@@ -50,20 +51,22 @@
# }
-# variant plugins description {Build with experimental Plugin Support} {
-#
-# patchfiles-append patch-configure.diff \
-# patch-src-about.ui.diff \
-# patch-src-main.cpp.diff \
-# patch-src-main.h.diff \
-# patch-src-options-opt_plugins.cpp.diff \
-# patch-src-options-opt_plugins.h.diff \
-# patch-src-pluginmanager.cpp.diff \
-# patch-src-pluginmanager.h.diff \
-# patch-src-psiaccount.cpp.diff \
-# patch-src-psichatdlg.cpp.diff \
-# patch-src-psichatdlg.h.diff \
-# patch-src-psiplugin.h.diff
-#
-# configure.args-append --enable-plugins
-# }
+variant plugins description {Build with experimental Plugin Support} {
+
+patchfiles-append patch-configure.diff \
+ patch-src-applicationinfo.cpp.diff \
+ patch-src-pluginhost.cpp.diff \
+ patch-src-pluginhost.h.diff \
+ patch-src-pluginmanager.cpp.diff \
+ patch-src-pluginmanager.h.diff \
+ patch-src-plugins-include-eventfilter.h.diff \
+ patch-src-plugins-include-iqfilter.h.diff \
+ patch-src-plugins-include-psiplugin.h.diff \
+ patch-src-plugins-include-stanzasender.h.diff \
+ patch-src-psiaccount.cpp.diff \
+ patch-src-psichatdlg.cpp.diff \
+ patch-src-psichatdlg.h.diff \
+ patch-src-src.pro.diff
+
+configure.args-append --enable-plugins
+}
Added: trunk/dports/net/psi/files/patch-configure.diff
===================================================================
--- trunk/dports/net/psi/files/patch-configure.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-configure.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,107 @@
+--- configure 2009-07-26 23:02:02.000000000 +0200
++++ configure 2009-08-05 22:53:55.000000000 +0200
+@@ -40,6 +40,8 @@
+ --disable-aspell Disable use of ASPELL
+ --with-aspell-inc=[path] Path to Aspell include files
+ --with-aspell-lib=[path] Path to Aspell library files
++ --disable-plugins Disable use of Plugins
++ --enable-plugins Enable Psi Plugin support
+ --enable-debug Enable debugging support
+
+ EOT
+@@ -242,6 +244,16 @@
+ shift
+ ;;
+
++ --disable-plugins)
++ QC_DISABLE_plugins="Y"
++ shift
++ ;;
++
++ --enable-plugins)
++ QC_ENABLE_PLUGINS="Y"
++ shift
++ ;;
++
+ --enable-debug)
+ QC_ENABLE_DEBUG="Y"
+ shift
+@@ -286,6 +298,8 @@
+ echo QC_DISABLE_aspell=$QC_DISABLE_aspell
+ echo QC_WITH_ASPELL_INC=$QC_WITH_ASPELL_INC
+ echo QC_WITH_ASPELL_LIB=$QC_WITH_ASPELL_LIB
++echo QC_DISABLE_plugins=$QC_DISABLE_plugins
++echo QC_ENABLE_PLUGINS=$QC_ENABLE_PLUGINS
+ echo QC_ENABLE_DEBUG=$QC_ENABLE_DEBUG
+ echo
+ fi
+@@ -1062,6 +1076,50 @@
+ return true;
+ }
+ };
++
++#line 1 "plugins.qcm"
++/*
++-----BEGIN QCMOD-----
++name: Plugins
++arg: enable-plugins,Enable Psi Plugin support
++
++-----END QCMOD-----
++*/
++
++//----------------------------------------------------------------------------
++// qc_plugins
++//----------------------------------------------------------------------------
++class qc_plugins : public ConfObj
++{
++public:
++ qc_plugins(Conf *c) : ConfObj(c) {}
++ QString name() const { return "Plugins"; }
++ QString shortname() const { return "Plugins"; }
++ bool exec()
++ {
++ QString s;
++
++ // Check if Jingle was enabled explicitly
++ s = conf->getenv("QC_ENABLE_PLUGINS");
++ if(s.isEmpty())
++ return false;
++
++ conf->addDefine("PSI_PLUGINS");
++
++ // Finish
++ conf->addExtra("CONFIG += psi_plugins");
++
++ qWarning("");
++ qWarning("");
++ qWarning(" !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!");
++ qWarning(" PLUGIN SUPPORT IS STILL UNFINISHED !!!");
++ qWarning(" THE PLUGIN INTERFACE /WILL/ CHANGE !!!");
++ qWarning(" USE AT YOUR OWN RISK !!!");
++
++ return true;
++ }
++};
++
+ #line 1 "debug.qcm"
+ /*
+ -----BEGIN QCMOD-----
+@@ -1190,6 +1248,9 @@
+ o = new qc_aspell(conf);
+ o->required = false;
+ o->disabled = false;
++ o = new qc_plugins(conf);
++ o->required = false;
++ o->disabled = false;
+ o = new qc_debug(conf);
+ o->required = true;
+ o->disabled = false;
+@@ -2211,6 +2272,8 @@
+ export QC_DISABLE_aspell
+ export QC_WITH_ASPELL_INC
+ export QC_WITH_ASPELL_LIB
++export QC_DISABLE_plugins
++export QC_ENABLE_PLUGINS
+ export QC_ENABLE_DEBUG
+ export QC_VERBOSE
+ rm -rf .qconftemp
Added: trunk/dports/net/psi/files/patch-src-applicationinfo.cpp.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-applicationinfo.cpp.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-applicationinfo.cpp.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,11 @@
+--- src/applicationinfo.cpp 2009-07-26 23:03:04.000000000 +0200
++++ src/applicationinfo.cpp 2009-08-05 22:53:55.000000000 +0200
+@@ -27,7 +27,7 @@
+
+ #define PROG_NAME "Psi"
+ //#define PROG_VERSION "0.13-dev" " (" __DATE__ ")"; //CVS Builds are dated
+-#define PROG_VERSION "0.13";
++#define PROG_VERSION "0.13-patched";
+ #define PROG_CAPS_NODE "http://psi-im.org/caps";
+ #define PROG_CAPS_VERSION "0.13-dev-rev2";
+ #define PROG_IPC_NAME "org.psi-im.Psi" // must not contain '\\' character on Windows
Added: trunk/dports/net/psi/files/patch-src-pluginhost.cpp.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-pluginhost.cpp.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-pluginhost.cpp.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,131 @@
+--- src/pluginhost.cpp 2009-07-26 23:02:02.000000000 +0200
++++ src/pluginhost.cpp 2009-08-05 22:53:55.000000000 +0200
+@@ -17,6 +17,7 @@
+ #include "iqnamespacefilter.h"
+ #include "eventfilter.h"
+ #include "optionaccessor.h"
++#include "applicationinfo.h"
+
+ /**
+ * \brief Constructs a host/wrapper for a plugin.
+@@ -32,12 +33,17 @@
+ */
+ PluginHost::PluginHost(PluginManager* manager, const QString& pluginFile)
+ : manager_(manager)
+- , file_(pluginFile)
+ , plugin_(0)
++ , file_(pluginFile)
++ , name_()
++ , shortName_()
++ , version_()
+ , loader_(0)
++ , valid_(false)
+ , connected_(false)
+ , enabled_(false)
+- , valid_(false)
++ , iqNsFilters_()
++ , iqNsxFilters_()
+ {
+ load(); // reads plugin name, etc
+ unload();
+@@ -250,6 +256,12 @@
+ qDebug("connecting option accessor");
+ o->setOptionAccessingHost(this);
+ }
++
++ PsiPlugin* p = qobject_cast<PsiPlugin*>(plugin_);
++ if (p)
++ {
++ p->setHomeDir(ApplicationInfo::homeDir());
++ }
+
+ connected_ = true;
+ }
+@@ -396,7 +408,8 @@
+ * \param subject Message subject
+ * \return Continue processing the event; true if the stanza should be silently discarded.
+ */
+-bool PluginHost::processMessage(int account, const QString& jidFrom, const QString& body, const QString& subject)
++bool PluginHost::processMessage(int account, const QString& jidFrom,
++ QString& body, QString& subject)
+ {
+ bool handled = false;
+ EventFilter *ef = qobject_cast<EventFilter*>(plugin_);
+@@ -406,6 +419,28 @@
+ return handled;
+ }
+
++bool PluginHost::processMessage(int account, const QString& jidFrom,
++ QDomElement& htmlBody, QString& subject)
++{
++ bool handled = false;
++ EventFilter *ef = qobject_cast<EventFilter*>(plugin_);
++ if (ef && ef->processMessage(account, jidFrom, htmlBody, subject)) {
++ handled = true;
++ }
++ return handled;
++}
++
++bool PluginHost::processOutgoingMessage(int account, const QString& jidTo,
++ QString& body, QString& subject)
++{
++ bool handled = false;
++ EventFilter *ef = qobject_cast<EventFilter*>(plugin_);
++ if (ef && ef->processOutgoingMessage(account, jidTo, body, subject)) {
++ handled = true;
++ }
++ return handled;
++}
++
+
+ //-- StanzaSender ---------------------------------------------------
+
+@@ -564,6 +599,8 @@
+ */
+ void PluginHost::setPluginOption( const QString& option, const QVariant& value)
+ {
++ Q_UNUSED(option)
++ Q_UNUSED(value)
+ // TODO(mck)
+
+ //PsiPlugin* plugin=NULL;
+@@ -587,6 +624,7 @@
+ */
+ QVariant PluginHost::getPluginOption(const QString& option)
+ {
++ Q_UNUSED(option)
+ return QVariant(); // TODO(mck)
+ }
+
+@@ -617,6 +655,31 @@
+ }
+
+
++void PluginHost::logout(int account)
++{
++ qobject_cast<PsiPlugin*>(plugin_)->logout(account);
++}
++
++void PluginHost::contactOnline(int account, const QString& jid)
++{
++ qobject_cast<PsiPlugin*>(plugin_)->contactOnline(account, jid);
++}
++
++void PluginHost::contactOffline(int account, const QString& jid)
++{
++ qobject_cast<PsiPlugin*>(plugin_)->contactOffline(account, jid);
++}
++
++
++QAction* PluginHost::getChatDlgMenuEntries(QWidget* parent,
++ int account,
++ const QString& otherJid)
++{
++ return qobject_cast<PsiPlugin*>(plugin_)->getChatDlgMenuEntries(parent,
++ account,
++ otherJid);
++}
++
+ //-- helpers --------------------------------------------------------
+
+ static bool operator<(const QRegExp &a, const QRegExp &b)
Added: trunk/dports/net/psi/files/patch-src-pluginhost.h.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-pluginhost.h.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-pluginhost.h.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,40 @@
+--- src/pluginhost.h 2009-07-26 23:02:02.000000000 +0200
++++ src/pluginhost.h 2009-08-05 22:53:55.000000000 +0200
+@@ -17,6 +17,7 @@
+
+ class QWidget;
+ class QPluginLoader;
++class QAction;
+
+ class PluginManager;
+ class IqNamespaceFilter;
+@@ -54,7 +55,13 @@
+
+ // for EventFilter
+ bool processEvent(int account, const QDomElement& e);
+- bool processMessage(int account, const QString& jidFrom, const QString& body, const QString& subject);
++ bool processMessage(int account, const QString& jidFrom,
++ QString& body, QString& subject);
++ bool processMessage(int account, const QString& jidFrom,
++ QDomElement& body, QString& subject);
++
++ bool processOutgoingMessage(int account, const QString& jidTo,
++ QString& body, QString& subject);
+
+ // StanzaSendingHost
+ void sendStanza(int account, const QDomElement& xml);
+@@ -74,6 +81,14 @@
+ void setGlobalOption(const QString& option, const QVariant& value);
+ QVariant getGlobalOption(const QString& option);
+
++
++ void logout(int account);
++ void contactOnline(int account, const QString& jid);
++ void contactOffline(int account, const QString& jid);
++
++ QAction* getChatDlgMenuEntries(QWidget* parent, int account,
++ const QString& otherJid);
++
+ private:
+ PluginManager* manager_;
+ QObject* plugin_;
Added: trunk/dports/net/psi/files/patch-src-pluginmanager.cpp.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-pluginmanager.cpp.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-pluginmanager.cpp.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,184 @@
+--- src/pluginmanager.cpp 2009-07-26 23:02:02.000000000 +0200
++++ src/pluginmanager.cpp 2009-08-05 22:53:55.000000000 +0200
+@@ -147,6 +147,7 @@
+ */
+ void PluginManager::optionChanged(const QString& option)
+ {
++ Q_UNUSED(option)
+ //QString("%1.%2").arg(loadOptionPrefix).arg(shortNames_[plugin]);
+
+ //TODO(mck): implement this... for now, enabling/disabling requires psi restart
+@@ -236,7 +237,7 @@
+ QWidget* PluginManager::optionsWidget(const QString& plugin)
+ {
+ QWidget* widget = 0;
+- if (hosts_.contains(plugin)) {
++ if (hosts_.contains(plugin) && hosts_[plugin]->isEnabled()) {
+ widget = hosts_[plugin]->optionsWidget();
+ } else {
+ qWarning(qPrintable(QString("Attempting to get options for %1 which doesn't exist").arg(plugin)));
+@@ -254,19 +255,60 @@
+ * \param event Incoming event
+ * \return Continue processing the event; true if the event should be silently discarded.
+ */
+-bool PluginManager::processMessage(const PsiAccount* account, const QString& jidFrom, const QString& body, const QString& subject)
++bool PluginManager::processMessage(const PsiAccount* account, const QString& jidFrom,
++ QString& body, QString& subject)
+ {
+ bool handled = false;
+ foreach (PluginHost* host, hosts_.values()) {
+- if (host->processMessage(accountIds_[account], jidFrom, body, subject)) {
+- handled = true;
+- break;
+- }
++ if (host->isEnabled())
++ {
++ if (host->processMessage(accountIds_[account], jidFrom, body, subject)) {
++ handled = true;
++ break;
++ }
++ }
++ }
++ return handled;
++}
++
++bool PluginManager::processMessage(const PsiAccount* account, const QString& jidFrom,
++ QDomElement& htmlBody, QString& subject)
++{
++ bool handled = false;
++ foreach (PluginHost* host, hosts_.values()) {
++ if (host->isEnabled())
++ {
++ if (host->processMessage(accountIds_[account], jidFrom, htmlBody, subject)) {
++ handled = true;
++ break;
++ }
++ }
+ }
+ return handled;
+ }
+
+ /**
++ * process an outgoing message
++ */
++bool PluginManager::processOutgoingMessage(const PsiAccount* account, const QString& jidTo,
++ QString& body, QString& subject)
++{
++ bool handled = false;
++ foreach (PluginHost* host, hosts_.values()) {
++ if (host->isEnabled())
++ {
++ if (host->processOutgoingMessage(accountIds_[account], jidTo,
++ body, subject)) {
++ handled = true;
++ break;
++ }
++ }
++ }
++ return handled;
++}
++
++
++/**
+ * \brief Give each plugin the opportunity to process the incoming event
+ *
+ * Each plugin is passed the event in turn. Any plugin may then modify the event
+@@ -280,10 +322,13 @@
+ {
+ bool handled = false;
+ foreach (PluginHost* host, hosts_.values()) {
+- if (host->processEvent(accountIds_[account], event)) {
+- handled = true;
+- break;
+- }
++ if (host->isEnabled())
++ {
++ if (host->processEvent(accountIds_[account], event)) {
++ handled = true;
++ break;
++ }
++ }
+ }
+ return handled;
+ }
+@@ -304,10 +349,13 @@
+ {
+ bool handled = false;
+ foreach (PluginHost* host, hosts_.values()) {
+- if (host->incomingXml(account, xml)) {
+- handled = true;
+- break;
+- }
++ if (host->isEnabled())
++ {
++ if (host->incomingXml(account, xml)) {
++ handled = true;
++ break;
++ }
++ }
+ }
+ return handled;
+ }
+@@ -369,6 +417,62 @@
+ return true;
+ }
+
++void PluginManager::logout(const PsiAccount* account)
++{
++ foreach (PluginHost* host, hosts_.values())
++ {
++ if (host->isEnabled())
++ {
++ host->logout(accountIds_[account]);
++ }
++ }
++}
++
++
++void PluginManager::contactOnline(const PsiAccount* account, const QString& jid)
++{
++ foreach (PluginHost* host, hosts_.values())
++ {
++ if (host->isEnabled())
++ {
++ host->contactOnline(accountIds_[account], jid);
++ }
++ }
++}
++
++void PluginManager::contactOffline(const PsiAccount* account, const QString& jid)
++{
++ foreach (PluginHost* host, hosts_.values())
++ {
++ if (host->isEnabled())
++ {
++ host->contactOffline(accountIds_[account], jid);
++ }
++ }
++}
++
++QList<QAction*> PluginManager::getChatDlgMenuEntries(QWidget* parent,
++ const PsiAccount* account,
++ const QString& otherJid)
++{
++ QList<QAction*> res;
++ foreach(PluginHost* host, hosts_.values())
++ {
++ if (host->isEnabled())
++ {
++ QAction* m = host->getChatDlgMenuEntries(parent,
++ accountIds_[account],
++ otherJid);
++ if (m)
++ {
++ res.append(m);
++ }
++ }
++ }
++ return res;
++}
++
++
+ PluginManager* PluginManager::instance_ = NULL;
+ const QString PluginManager::loadOptionPrefix = "plugins.auto-load";
+ const QString PluginManager::pluginOptionPrefix = "plugins.options";
Added: trunk/dports/net/psi/files/patch-src-pluginmanager.h.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-pluginmanager.h.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-pluginmanager.h.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,39 @@
+--- src/pluginmanager.h 2009-07-26 23:02:02.000000000 +0200
++++ src/pluginmanager.h 2009-08-05 22:53:55.000000000 +0200
+@@ -13,6 +13,7 @@
+ #include <QDomElement>
+
+ class QPluginLoader;
++class QAction;
+
+ class PsiAccount;
+ class PsiPlugin;
+@@ -46,11 +47,26 @@
+ QWidget* optionsWidget(const QString& plugin);
+
+ bool processEvent(const PsiAccount* account, QDomElement& eventXml);
+- bool processMessage(const PsiAccount* account, const QString& jidFrom, const QString& body, const QString& subject);
++ bool processMessage(const PsiAccount* account, const QString& jidFrom,
++ QString& body, QString& subject);
++ bool processMessage(const PsiAccount* account, const QString& jidFrom,
++ QDomElement& htmlBody, QString& subject);
+
++ bool processOutgoingMessage(const PsiAccount* account, const QString& jidTo,
++ QString& body, QString& subject);
++
++ void logout(const PsiAccount* account);
++ void contactOnline(const PsiAccount* account, const QString& jid);
++ void contactOffline(const PsiAccount* account, const QString& jid);
++
+ static const QString loadOptionPrefix;
+ static const QString pluginOptionPrefix;
+-
++
++ QList<QAction*> getChatDlgMenuEntries(QWidget* parent,
++ const PsiAccount* account,
++ const QString& otherjid);
++
++
+ private:
+ PluginManager();
+ void loadAllPlugins();
Added: trunk/dports/net/psi/files/patch-src-plugins-include-eventfilter.h.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-plugins-include-eventfilter.h.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-plugins-include-eventfilter.h.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,19 @@
+--- src/plugins/include/eventfilter.h 2009-07-26 23:02:03.000000000 +0200
++++ src/plugins/include/eventfilter.h 2009-08-05 22:53:55.000000000 +0200
+@@ -11,7 +11,15 @@
+ // true = handled, don't pass to next handler
+
+ virtual bool processEvent(int account, const QDomElement& e) = 0;
+- virtual bool processMessage(int account, const QString& fromJid, const QString& body, const QString& subject) = 0;
++
++ virtual bool processMessage(int account, const QString& fromJid,
++ QString& body, QString& subject) = 0;
++
++ virtual bool processMessage(int account, const QString& fromJid,
++ QDomElement& body, QString& subject) = 0;
++
++ virtual bool processOutgoingMessage(int account, const QString& toJid,
++ QString& body, QString& subject) = 0;
+ };
+
+ Q_DECLARE_INTERFACE(EventFilter, "org.psi-im.EventFilter/0.1");
Added: trunk/dports/net/psi/files/patch-src-plugins-include-iqfilter.h.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-plugins-include-iqfilter.h.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-plugins-include-iqfilter.h.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,10 @@
+--- src/plugins/include/iqfilter.h 2009-07-26 23:02:03.000000000 +0200
++++ src/plugins/include/iqfilter.h 2009-08-05 22:53:55.000000000 +0200
+@@ -13,4 +13,5 @@
+
+ Q_DECLARE_INTERFACE(IqFilter, "org.psi-im.IqFilter/0.1");
+
+-#endif
+\ Kein Zeilenumbruch am Dateiende.
++#endif
++
Added: trunk/dports/net/psi/files/patch-src-plugins-include-psiplugin.h.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-plugins-include-psiplugin.h.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-plugins-include-psiplugin.h.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,18 @@
+--- src/plugins/include/psiplugin.h 2009-07-26 23:02:03.000000000 +0200
++++ src/plugins/include/psiplugin.h 2009-08-05 22:53:55.000000000 +0200
+@@ -87,6 +87,15 @@
+ */
+ virtual bool disable() = 0;
+
++ virtual void logout(int account) = 0;
++ virtual void contactOnline(int account, const QString& jid) = 0;
++ virtual void contactOffline(int account, const QString& jid) = 0;
++
++ virtual QAction* getChatDlgMenuEntries(QWidget* parent,
++ int account,
++ const QString& otherJid) = 0;
++
++ virtual void setHomeDir(const QString& dir) = 0;
+ };
+
+ Q_DECLARE_INTERFACE(PsiPlugin, "org.psi-im.PsiPlugin/0.3");
Added: trunk/dports/net/psi/files/patch-src-plugins-include-stanzasender.h.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-plugins-include-stanzasender.h.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-plugins-include-stanzasender.h.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,10 @@
+--- src/plugins/include/stanzasender.h 2009-07-26 23:02:03.000000000 +0200
++++ src/plugins/include/stanzasender.h 2009-08-05 22:53:55.000000000 +0200
+@@ -13,4 +13,5 @@
+
+ Q_DECLARE_INTERFACE(StanzaSender, "org.psi-im.StanzaSender/0.1");
+
+-#endif
+\ Kein Zeilenumbruch am Dateiende.
++#endif
++
Added: trunk/dports/net/psi/files/patch-src-psiaccount.cpp.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-psiaccount.cpp.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-psiaccount.cpp.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,154 @@
+--- src/psiaccount.cpp 2009-07-26 23:02:03.000000000 +0200
++++ src/psiaccount.cpp 2009-08-05 22:53:55.000000000 +0200
+@@ -901,9 +901,6 @@
+
+ PsiAccount::~PsiAccount()
+ {
+-#ifdef __GNUC__
+-#warning "Uncomment these"
+-#endif
+ #ifdef PSI_PLUGINS
+ // PluginManager::instance()->removeClient(this);
+ #endif
+@@ -1288,6 +1285,10 @@
+ // disconnect or stop reconnecting
+ void PsiAccount::logout(bool fast, const Status &s)
+ {
++#ifdef PSI_PLUGINS
++ PluginManager::instance()->logout(this);
++#endif
++
+ if(!isActive())
+ return;
+
+@@ -1889,6 +1890,10 @@
+ UserResourceList::Iterator rit = u->userResourceList().find(j.resource());
+ bool found = (rit == u->userResourceList().end()) ? false: true;
+ if(!found) {
++#ifdef PSI_PLUGINS
++ PluginManager::instance()->contactOnline(this, j.node() + "@" + j.domain());
++#endif
++
+ popupType = PopupOnline;
+
+ UserResource ur(r);
+@@ -2044,6 +2049,10 @@
+ PsiGrowlNotifier::instance()->popup(this, PsiPopup::AlertOffline, j, r, u);
+ #endif
+ }
++#ifdef PSI_PLUGINS
++ PluginManager::instance()->contactOffline(this, j.node() + "@" + j.domain());
++#endif
++
+ }
+
+ void PsiAccount::client_presenceError(const Jid &j, int, const QString &str)
+@@ -3002,7 +3011,6 @@
+ if(pp)
+ p = *pp;
+ #ifdef __GNUC__
+-#warning "Removed reparenting call from qwextend"
+ #endif
+ //reparent_good(window, 0, false);
+ if(!p.isNull())
+@@ -3639,6 +3647,25 @@
+ }
+ }
+
++#ifdef PSI_PLUGINS
++ if (nm.type() != "groupchat" && !nm.body().isEmpty())
++ {
++ QString body = nm.body();
++ QString subject = nm.subject();
++
++ PluginManager::instance()->processOutgoingMessage(this, nm.to().full(),
++ body, subject);
++ if (body != nm.body())
++ {
++ nm.setBody(body);
++ }
++ if (subject != nm.subject())
++ {
++ nm.setSubject(subject);
++ }
++ }
++#endif
++
+ d->client->sendMessage(nm);
+
+ // only toggle if not an invite or body is not empty
+@@ -3913,6 +3940,53 @@
+ }
+ //FIXME(KIS): must now cause the event to be recreated from this xml or such. Horrid.
+ #endif
++
++#ifdef PSI_PLUGINS
++ if(e->type() == PsiEvent::Message)
++ {
++ MessageEvent* messageEvent = (MessageEvent*) e;
++ Message message = messageEvent->message();
++
++ if (message.type() != "groupchat")
++ {
++
++ bool discard = false;
++ if (message.containsHTML() && !message.html().text().isEmpty())
++ {
++ HTMLElement htmlElement = message.html();
++ QDomElement htmlBody = htmlElement.body();
++ QString subject = message.subject();
++
++ discard = PluginManager::instance()->processMessage(this, e->from().full(),
++ htmlBody, subject);
++ htmlElement.setBody(htmlBody);
++ message.setHTML(htmlElement, message.lang());
++ message.setBody(htmlElement.text());
++ message.setSubject(subject);
++ }
++ else if (!message.body().isEmpty())
++ {
++ QString body = message.body();
++ QString subject = message.subject();
++
++ discard = PluginManager::instance()->processMessage(this, e->from().full(),
++ body, subject);
++ message.setBody(body);
++ message.setSubject(subject);
++ }
++
++ if (discard)
++ {
++ delete e;
++ return;
++ }
++
++ messageEvent->setMessage(message);
++ }
++ }
++#endif
++
++
+
+ if(d->acc.opt_log && activationType != FromXml) {
+ if(e->type() == PsiEvent::Message || e->type() == PsiEvent::Auth) {
+@@ -3926,20 +4000,6 @@
+ MessageEvent *me = (MessageEvent *)e;
+ const Message &m = me->message();
+
+-#ifdef PSI_PLUGINS
+- //TODO(mck): clean up
+- //UserListItem *ulItem=NULL;
+- //if ( !ul.isEmpty() )
+- // ulItem=ul.first();
+- if (PluginManager::instance()->processMessage(this, e->from().full(), m.body(), m.subject())) {
+- delete e;
+- return;
+- }
+- //PluginManager::instance()->message(this,e->from(),ulItem,((MessageEvent*)e)->message().body());
+-#endif
+-
+-
+-
+ // Pass message events to chat window
+ if ((m.containsEvents() || m.chatState() != StateNone) && m.body().isEmpty()) {
+ if (PsiOptions::instance()->getOption("options.messages.send-composing-events").toBool()) {
Added: trunk/dports/net/psi/files/patch-src-psichatdlg.cpp.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-psichatdlg.cpp.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-psichatdlg.cpp.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,51 @@
+--- src/psichatdlg.cpp 2009-07-26 23:02:03.000000000 +0200
++++ src/psichatdlg.cpp 2009-08-05 22:53:55.000000000 +0200
+@@ -40,6 +40,7 @@
+ #include "jidutil.h"
+ #include "textutil.h"
+ #include "xmpp_tasks.h"
++#include "pluginmanager.h"
+
+
+ #define MCMDCHAT "http://psi-im.org/ids/mcmd#chatmain"
+@@ -301,6 +302,12 @@
+
+ act_compact_ = new IconAction(tr("Toggle Compact/Full Size"), "psi/compact", tr("Toggle Compact/Full Size"), 0, this);
+ connect(act_compact_, SIGNAL(activated()), SLOT(toggleSmallChat()));
++
++#ifdef PSI_PLUGINS
++ act_plugins_ = PluginManager::instance()->getChatDlgMenuEntries(this,
++ account(),
++ jid().full());
++#endif
+ }
+
+ void PsiChatDlg::initToolBar()
+@@ -319,6 +326,13 @@
+ if (account()->voiceCaller()) {
+ ui_.toolbar->addAction(act_voice_);
+ }
++#ifdef PSI_PLUGINS
++ foreach (QAction* i, act_plugins_ )
++ {
++ ui_.toolbar->addAction(i);
++ }
++#endif
++
+ }
+
+ void PsiChatDlg::contextMenuEvent(QContextMenuEvent *)
+@@ -476,6 +490,13 @@
+
+ pm_settings_->addAction(act_info_);
+ pm_settings_->addAction(act_history_);
++#ifdef PSI_PLUGINS
++ foreach (QAction* a, act_plugins_)
++ {
++ pm_settings_->insertSeparator();
++ pm_settings_->addAction(a);
++ }
++#endif
+ }
+
+ void PsiChatDlg::updateCounter()
Added: trunk/dports/net/psi/files/patch-src-psichatdlg.h.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-psichatdlg.h.diff (rev 0)
+++ trunk/dports/net/psi/files/patch-src-psichatdlg.h.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -0,0 +1,14 @@
+--- src/psichatdlg.h 2009-07-26 23:02:03.000000000 +0200
++++ src/psichatdlg.h 2009-08-05 22:53:55.000000000 +0200
+@@ -77,6 +77,10 @@
+ IconAction* act_file_;
+ IconAction* act_compact_;
+ IconAction* act_voice_;
++#ifdef PSI_PLUGINS
++ QList<QAction*> act_plugins_;
++#endif
++
+
+ QAction *act_mini_cmd_;
+
+
Modified: trunk/dports/net/psi/files/patch-src-src.pro.diff
===================================================================
--- trunk/dports/net/psi/files/patch-src-src.pro.diff 2009-08-13 15:47:01 UTC (rev 55567)
+++ trunk/dports/net/psi/files/patch-src-src.pro.diff 2009-08-13 16:16:45 UTC (rev 55568)
@@ -1,11 +1,11 @@
---- src/src.pro.orig 2009-04-09 15:02:33.000000000 +0200
-+++ src/src.pro 2009-04-09 14:43:49.000000000 +0200
-@@ -63,7 +63,7 @@
- }
+--- src/src.pro 2009-07-26 23:02:03.000000000 +0200
++++ src/src.pro 2009-08-05 22:53:55.000000000 +0200
+@@ -10,7 +10,7 @@
+ #CONFIG += use_crash
+ CONFIG += pep
+ #CONFIG += whiteboarding
+-#CONFIG += psi_plugins
++CONFIG += psi_plugins
+ DEFINES += QT_STATICPLUGIN
- # IPv6 ?
--#DEFINES += NO_NDNS
-+DEFINES += NO_NDNS
-
- # Psi sources
- include(src.pri)
+ # Import several very useful Makefile targets
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090813/ac17a9d7/attachment-0001.html>
More information about the macports-changes
mailing list