diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2019-12-11 01:41:26 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-12-11 02:23:35 +0100 |
commit | 73f00336178a9f312bac2992649120d462e0ac2d (patch) | |
tree | 8672519cb50cb0e642af0817188ad28f810338ee /kopete/plugins/netmeeting/netmeetingplugin.cpp | |
parent | 914254104c50dec222fb31ce7a25a21870e90f16 (diff) | |
download | tdenetwork-73f00336178a9f312bac2992649120d462e0ac2d.tar.gz tdenetwork-73f00336178a9f312bac2992649120d462e0ac2d.zip |
kopete: Restore the MSN protocol because a replacement MSN server was created.
This reverts commits 0486034738 - 2d5f9c55da and f6fd4ab6c0.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'kopete/plugins/netmeeting/netmeetingplugin.cpp')
-rw-r--r-- | kopete/plugins/netmeeting/netmeetingplugin.cpp | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/kopete/plugins/netmeeting/netmeetingplugin.cpp b/kopete/plugins/netmeeting/netmeetingplugin.cpp new file mode 100644 index 00000000..17dfcc0b --- /dev/null +++ b/kopete/plugins/netmeeting/netmeetingplugin.cpp @@ -0,0 +1,91 @@ +/* + netmeetingplugin.cpp + + Copyright (c) 2003-2004 by Olivier Goffart <ogoffart @ kde.org> + + ************************************************************************* + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ************************************************************************* +*/ + +#include "netmeetingplugin.h" + +#include <kdebug.h> +#include <kgenericfactory.h> +#include <tdeaction.h> +#include <tdeversion.h> +#include <tdeaboutdata.h> + +#include "kopetepluginmanager.h" +#include "kopetechatsessionmanager.h" + +#include "msnchatsession.h" +#include "msnprotocol.h" +#include "msncontact.h" + +#include "netmeetinginvitation.h" +#include "netmeetingguiclient.h" + + +static const TDEAboutData aboutdata("kopete_netmeeting", I18N_NOOP("NetMeeting") , "1.0" ); +K_EXPORT_COMPONENT_FACTORY( kopete_netmeeting, KGenericFactory<NetMeetingPlugin>( &aboutdata ) ) + +NetMeetingPlugin::NetMeetingPlugin( TQObject *parent, const char *name, const TQStringList &/*args*/ ) +: Kopete::Plugin( TDEGlobal::instance(), parent, name ) +{ + if(MSNProtocol::protocol()) + slotPluginLoaded(MSNProtocol::protocol()); + else + connect(Kopete::PluginManager::self() , TQT_SIGNAL(pluginLoaded(Kopete::Plugin*) ), this, TQT_SLOT(slotPluginLoaded(Kopete::Plugin*))); + + + connect( Kopete::ChatSessionManager::self(), TQT_SIGNAL( chatSessionCreated( Kopete::ChatSession * )) , TQT_SLOT( slotNewKMM( Kopete::ChatSession * ) ) ); + //Add GUI action to all already existing kmm (if the plugin is launched when kopete already rining) + TQValueList<Kopete::ChatSession*> sessions = Kopete::ChatSessionManager::self()->sessions(); + for (TQValueListIterator<Kopete::ChatSession*> it= sessions.begin(); it!=sessions.end() ; ++it) + { + slotNewKMM(*it); + } +} + +NetMeetingPlugin::~NetMeetingPlugin() +{ + +} + +void NetMeetingPlugin::slotPluginLoaded(Kopete::Plugin *p) +{ + if(p->pluginId()=="MSNProtocol") + { + connect( p , TQT_SIGNAL(invitation(MSNInvitation*& , const TQString & , long unsigned int , MSNChatSession* , MSNContact* )) , + this, TQT_SLOT( slotInvitation(MSNInvitation*& , const TQString & , long unsigned int , MSNChatSession* , MSNContact* ))); + } +} + +void NetMeetingPlugin::slotNewKMM(Kopete::ChatSession *KMM) +{ + MSNChatSession *msnMM=dynamic_cast<MSNChatSession*>(KMM); + if(msnMM) + { + connect(this , TQT_SIGNAL( destroyed(TQObject*)) , + new NetMeetingGUIClient(msnMM) + , TQT_SLOT(deleteLater())); + } +} + + +void NetMeetingPlugin::slotInvitation(MSNInvitation*& invitation, const TQString &bodyMSG , long unsigned int /*cookie*/ , MSNChatSession* msnMM , MSNContact* c ) +{ + if(!invitation && bodyMSG.contains(NetMeetingInvitation::applicationID())) + { + invitation=new NetMeetingInvitation(true,c,msnMM); + invitation->parseInvitation(bodyMSG); + } +} + +#include "netmeetingplugin.moc" |