summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/netmeeting
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/plugins/netmeeting
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/plugins/netmeeting')
-rw-r--r--kopete/plugins/netmeeting/Makefile.am23
-rw-r--r--kopete/plugins/netmeeting/kopete_netmeeting.desktop81
-rw-r--r--kopete/plugins/netmeeting/kopete_netmeeting_config.desktop77
-rw-r--r--kopete/plugins/netmeeting/netmeetingchatui.rc9
-rw-r--r--kopete/plugins/netmeeting/netmeetingguiclient.cpp61
-rw-r--r--kopete/plugins/netmeeting/netmeetingguiclient.h60
-rw-r--r--kopete/plugins/netmeeting/netmeetinginvitation.cpp183
-rw-r--r--kopete/plugins/netmeeting/netmeetinginvitation.h56
-rw-r--r--kopete/plugins/netmeeting/netmeetingplugin.cpp91
-rw-r--r--kopete/plugins/netmeeting/netmeetingplugin.h46
-rw-r--r--kopete/plugins/netmeeting/netmeetingpreferences.cpp81
-rw-r--r--kopete/plugins/netmeeting/netmeetingpreferences.h46
-rw-r--r--kopete/plugins/netmeeting/netmeetingprefs_ui.ui148
13 files changed, 962 insertions, 0 deletions
diff --git a/kopete/plugins/netmeeting/Makefile.am b/kopete/plugins/netmeeting/Makefile.am
new file mode 100644
index 00000000..2b3560be
--- /dev/null
+++ b/kopete/plugins/netmeeting/Makefile.am
@@ -0,0 +1,23 @@
+METASOURCES = AUTO
+
+AM_CPPFLAGS = $(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/protocols/msn $(all_includes)
+
+kde_module_LTLIBRARIES = kopete_netmeeting.la kcm_kopete_netmeeting.la
+
+kopete_netmeeting_la_SOURCES = netmeetingplugin.cpp netmeetinginvitation.cpp netmeetingguiclient.cpp
+kopete_netmeeting_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries)
+kopete_netmeeting_la_LIBADD = $(top_builddir)/kopete/libkopete/libkopete.la $(top_builddir)/kopete/protocols/msn/libkopete_msn_shared.la
+
+service_DATA = kopete_netmeeting.desktop
+servicedir = $(kde_servicesdir)
+
+mydatadir = $(kde_datadir)/kopete_netmeeting
+mydata_DATA = netmeetingchatui.rc
+
+kcm_kopete_netmeeting_la_SOURCES = netmeetingprefs_ui.ui netmeetingpreferences.cpp
+kcm_kopete_netmeeting_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries)
+kcm_kopete_netmeeting_la_LIBADD = $(LIB_KOPETECOMPAT) $(LIB_KUTILS)
+
+
+kcm_DATA = kopete_netmeeting_config.desktop
+kcmdir = $(kde_servicesdir)/kconfiguredialog
diff --git a/kopete/plugins/netmeeting/kopete_netmeeting.desktop b/kopete/plugins/netmeeting/kopete_netmeeting.desktop
new file mode 100644
index 00000000..3636f6ce
--- /dev/null
+++ b/kopete/plugins/netmeeting/kopete_netmeeting.desktop
@@ -0,0 +1,81 @@
+[Desktop Entry]
+Type=Service
+X-Kopete-Version=1000900
+Icon=phone
+ServiceTypes=Kopete/Plugin
+X-KDE-Library=kopete_netmeeting
+X-KDE-PluginInfo-Author=Olivier Goffart
+X-KDE-PluginInfo-Name=kopete_netmeeting
+X-KDE-PluginInfo-Version=0.8.0
+X-KDE-PluginInfo-Website=http://kopete.kde.org
+X-KDE-PluginInfo-Category=Plugins
+X-KDE-PluginInfo-Depends=kopete_msn
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=false
+Name=Netmeeting
+Name[ar]=الاجتماع على الشبكة
+Name[bg]=Видео чат
+Name[bn]=নেট মিটিং
+Name[da]=Netmøde
+Name[eo]=Reta renkontiĝo
+Name[fa]=نت میتینگ
+Name[fr]=Vidéo-conférence
+Name[hi]=नेटमीटिंग
+Name[ja]=ネットミーティング
+Name[km]=ប្រជុំ​លើ​បណ្ដាញ
+Name[lt]=Bendravimas tinkle
+Name[nds]=Nettmööt
+Name[ne]=नेट मिटिङ
+Name[nl]=NetMeeting
+Name[pa]=ਨੈੱਟ-ਮੀਟਿੰਗ
+Name[sv]=Nätverksmöte
+Name[ta]=இணைய சந்திப்பு
+Name[tg]=Вохӯриҳои шабакавӣ
+Comment=Voice and Video with MSN Messenger
+Comment[be]=Гук і відэа праз MSN Messenger
+Comment[bg]=Приставка за разговор с глас и видео с MSN Messenger
+Comment[bn]=এমএসএন বার্তাবাহকের সঙ্গে স্বর এবং ভিডিও
+Comment[bs]=Glas i video sa MSN Messengerom
+Comment[ca]=Veu i vídeo amb MSN Messenger
+Comment[cs]=Hlas a video pomocí MSN Messenger
+Comment[da]=Stemme og video med MSN Messenger
+Comment[de]=Sprache und Video mit dem MSN-Messenger verwenden
+Comment[el]=Βίντεο και εικόνα με το MSN Messenger
+Comment[es]=Voz y vídeo con MSN Messenger
+Comment[et]=Audio ja video kasutamine MSN Messengeriga
+Comment[eu]=Ahotsa eta bideoa MSN Messenger-ekin
+Comment[fa]=ویدیو و صدا با پیام‌رسان ام‌اس‌ان
+Comment[fi]=Ääni ja videokuva MSN Messengerin kanssa
+Comment[fr]=Voix et vidéo avec MSN Messenger
+Comment[gl]=Voz e video con MSN Messenger
+Comment[he]=חוזי ושמע עם MSN Messenger
+Comment[hu]=Hang és videó az MSN Messengerrel
+Comment[is]=Hljóð og vídeó með MSN Messenger
+Comment[it]=Voce e video con MSN Messenger
+Comment[ja]=MSN メッセンジャーとボイス/ビデオチャット
+Comment[ka]=ხმა და ვიდეო MSN მესინჯერთან
+Comment[kk]=MSN Messenger дыбыс пен бейнемен
+Comment[km]=សំឡេង និង​វីដេអូ​ដោយ​ប្រើ​កម្មវិធី​ផ្ញើ​សារ MSN
+Comment[lt]=Bendravimas balsu ir vaizdu per MSN Messenger
+Comment[mk]=Глас и видео со Гласникот на MSN
+Comment[nb]=Lyd og bilde med MSN Messenger
+Comment[nds]=Spraak un Video mit dat MSN-Kortnarichtenprogramm
+Comment[ne]=एमएसएन मेसेन्जरसँग आवाज र भिडियो
+Comment[nl]=Beeld en geluid met MSN Messenger
+Comment[nn]=Lyd og bilete med MSN Messenger
+Comment[pl]=Głos i wideo za pomocą MSN Messenger
+Comment[pt]=Voz e Vídeo com o MSN Messenger
+Comment[pt_BR]=Voz e Vídeo com o MSN Messenger
+Comment[ru]=Аудио и видео с MSN Messenger
+Comment[sk]=Hlas a video pomocou MSN Messenger
+Comment[sl]=Glas in video z MSN Messenger
+Comment[sr]=Глас и видео са MSN Messenger-ом
+Comment[sr@Latn]=Glas i video sa MSN Messenger-om
+Comment[sv]=Ljud och video med MSN Messenger
+Comment[ta]=எம்எஸ்என் செய்தியில் குரல் மற்றும் படக்காட்சி
+Comment[tr]=MSN Messenger ile Video ve Ses
+Comment[uk]=Аудіо і відео з MSN Messenger
+Comment[zh_CN]=与 MSN Messenger 一起使用影音
+Comment[zh_HK]=和 MSN Messenger 一起使用語音和視像
+Comment[zh_TW]=MSN Messenger 影像與聲音
diff --git a/kopete/plugins/netmeeting/kopete_netmeeting_config.desktop b/kopete/plugins/netmeeting/kopete_netmeeting_config.desktop
new file mode 100644
index 00000000..16f24f6c
--- /dev/null
+++ b/kopete/plugins/netmeeting/kopete_netmeeting_config.desktop
@@ -0,0 +1,77 @@
+[Desktop Entry]
+Icon=highlight
+Type=Service
+ServiceTypes=KCModule
+
+X-KDE-ModuleType=Library
+X-KDE-Library=kopete_netmeeting
+X-KDE-FactoryName=NetmeetingConfigFactory
+X-KDE-ParentApp=kopete_netmeeting
+X-KDE-ParentComponents=kopete_netmeeting
+
+Name=Netmeeting
+Name[ar]=الاجتماع على الشبكة
+Name[bg]=Видео чат
+Name[bn]=নেট মিটিং
+Name[da]=Netmøde
+Name[eo]=Reta renkontiĝo
+Name[fa]=نت میتینگ
+Name[fr]=Vidéo-conférence
+Name[hi]=नेटमीटिंग
+Name[ja]=ネットミーティング
+Name[km]=ប្រជុំ​លើ​បណ្ដាញ
+Name[lt]=Bendravimas tinkle
+Name[nds]=Nettmööt
+Name[ne]=नेट मिटिङ
+Name[nl]=NetMeeting
+Name[pa]=ਨੈੱਟ-ਮੀਟਿੰਗ
+Name[sv]=Nätverksmöte
+Name[ta]=இணைய சந்திப்பு
+Name[tg]=Вохӯриҳои шабакавӣ
+Comment=Voice and Video with MSN Messenger
+Comment[be]=Гук і відэа праз MSN Messenger
+Comment[bg]=Приставка за разговор с глас и видео с MSN Messenger
+Comment[bn]=এমএসএন বার্তাবাহকের সঙ্গে স্বর এবং ভিডিও
+Comment[bs]=Glas i video sa MSN Messengerom
+Comment[ca]=Veu i vídeo amb MSN Messenger
+Comment[cs]=Hlas a video pomocí MSN Messenger
+Comment[da]=Stemme og video med MSN Messenger
+Comment[de]=Sprache und Video mit dem MSN-Messenger verwenden
+Comment[el]=Βίντεο και εικόνα με το MSN Messenger
+Comment[es]=Voz y vídeo con MSN Messenger
+Comment[et]=Audio ja video kasutamine MSN Messengeriga
+Comment[eu]=Ahotsa eta bideoa MSN Messenger-ekin
+Comment[fa]=ویدیو و صدا با پیام‌رسان ام‌اس‌ان
+Comment[fi]=Ääni ja videokuva MSN Messengerin kanssa
+Comment[fr]=Voix et vidéo avec MSN Messenger
+Comment[gl]=Voz e video con MSN Messenger
+Comment[he]=חוזי ושמע עם MSN Messenger
+Comment[hu]=Hang és videó az MSN Messengerrel
+Comment[is]=Hljóð og vídeó með MSN Messenger
+Comment[it]=Voce e video con MSN Messenger
+Comment[ja]=MSN メッセンジャーとボイス/ビデオチャット
+Comment[ka]=ხმა და ვიდეო MSN მესინჯერთან
+Comment[kk]=MSN Messenger дыбыс пен бейнемен
+Comment[km]=សំឡេង និង​វីដេអូ​ដោយ​ប្រើ​កម្មវិធី​ផ្ញើ​សារ MSN
+Comment[lt]=Bendravimas balsu ir vaizdu per MSN Messenger
+Comment[mk]=Глас и видео со Гласникот на MSN
+Comment[nb]=Lyd og bilde med MSN Messenger
+Comment[nds]=Spraak un Video mit dat MSN-Kortnarichtenprogramm
+Comment[ne]=एमएसएन मेसेन्जरसँग आवाज र भिडियो
+Comment[nl]=Beeld en geluid met MSN Messenger
+Comment[nn]=Lyd og bilete med MSN Messenger
+Comment[pl]=Głos i wideo za pomocą MSN Messenger
+Comment[pt]=Voz e Vídeo com o MSN Messenger
+Comment[pt_BR]=Voz e Vídeo com o MSN Messenger
+Comment[ru]=Аудио и видео с MSN Messenger
+Comment[sk]=Hlas a video pomocou MSN Messenger
+Comment[sl]=Glas in video z MSN Messenger
+Comment[sr]=Глас и видео са MSN Messenger-ом
+Comment[sr@Latn]=Glas i video sa MSN Messenger-om
+Comment[sv]=Ljud och video med MSN Messenger
+Comment[ta]=எம்எஸ்என் செய்தியில் குரல் மற்றும் படக்காட்சி
+Comment[tr]=MSN Messenger ile Video ve Ses
+Comment[uk]=Аудіо і відео з MSN Messenger
+Comment[zh_CN]=与 MSN Messenger 一起使用影音
+Comment[zh_HK]=和 MSN Messenger 一起使用語音和視像
+Comment[zh_TW]=MSN Messenger 影像與聲音
diff --git a/kopete/plugins/netmeeting/netmeetingchatui.rc b/kopete/plugins/netmeeting/netmeetingchatui.rc
new file mode 100644
index 00000000..b0d139ae
--- /dev/null
+++ b/kopete/plugins/netmeeting/netmeetingchatui.rc
@@ -0,0 +1,9 @@
+<!DOCTYPE kpartgui>
+<kpartgui version="1" name="kopete_msn_netmeeting">
+ <MenuBar>
+ <Menu name="tools">
+ <text>&amp;Tools</text>
+ <Action name="netmeeting" />
+ </Menu>
+ </MenuBar>
+</kpartgui>
diff --git a/kopete/plugins/netmeeting/netmeetingguiclient.cpp b/kopete/plugins/netmeeting/netmeetingguiclient.cpp
new file mode 100644
index 00000000..e024a872
--- /dev/null
+++ b/kopete/plugins/netmeeting/netmeetingguiclient.cpp
@@ -0,0 +1,61 @@
+/*
+ netmeetingguiclient.cpp
+
+ Kopete NetMeeting plugin
+
+ Copyright (c) 2003-2004 by Olivier Goffart <ogoffart @ kde.org>
+
+ Kopete (c) 2003-2004 by the Kopete developers <[email protected]>
+
+ *************************************************************************
+ * *
+ * 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 <qvariant.h>
+
+#include <kdebug.h>
+#include <kaction.h>
+#include <klocale.h>
+#include <kgenericfactory.h>
+
+#include "msnchatsession.h"
+#include "msncontact.h"
+
+#include "netmeetingguiclient.h"
+#include "netmeetinginvitation.h"
+
+class NetMeetingPlugin;
+
+NetMeetingGUIClient::NetMeetingGUIClient( MSNChatSession *parent, const char *name )
+: QObject( parent, name ) , KXMLGUIClient(parent)
+{
+ setInstance(KGenericFactory<NetMeetingPlugin>::instance());
+ m_manager=parent;
+
+ new KAction( i18n( "Invite to Use NetMeeting" ), 0, this, SLOT( slotStartInvitation() ), actionCollection() , "netmeeting" ) ;
+
+ setXMLFile("netmeetingchatui.rc");
+}
+
+NetMeetingGUIClient::~NetMeetingGUIClient()
+{
+
+}
+
+void NetMeetingGUIClient::slotStartInvitation()
+{
+ QPtrList<Kopete::Contact> c=m_manager->members();
+ NetMeetingInvitation *i=new NetMeetingInvitation(false, static_cast<MSNContact*>(c.first()),m_manager);
+ m_manager->initInvitation(i);
+}
+
+#include "netmeetingguiclient.moc"
+
+// vim: set noet ts=4 sts=4 sw=4:
+
diff --git a/kopete/plugins/netmeeting/netmeetingguiclient.h b/kopete/plugins/netmeeting/netmeetingguiclient.h
new file mode 100644
index 00000000..fa84b694
--- /dev/null
+++ b/kopete/plugins/netmeeting/netmeetingguiclient.h
@@ -0,0 +1,60 @@
+/*
+ netmeetingguiclient.h
+
+ Kopete NetMeeting Plugin
+
+ Copyright (c) 2003 by Olivier Goffart <ogoffart @ kde.org>
+
+ Kopete (c) 2003 by the Kopete developers <[email protected]>
+
+ *************************************************************************
+ * *
+ * 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. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef TRANSLATORGUICLIENT_H
+#define TRANSLATORGUICLIENT_H
+
+#include <qobject.h>
+#include <kxmlguiclient.h>
+
+namespace Kopete { class ChatSession; }
+class MSNChatSession;
+class NetMeetingPlugin;
+
+/**
+ * @author Olivier Goffart <ogoffart @ kde.org>
+ */
+
+class NetMeetingGUIClient : public QObject , public KXMLGUIClient
+{
+ Q_OBJECT
+
+public:
+ NetMeetingGUIClient( MSNChatSession *parent, const char *name=0L);
+ ~NetMeetingGUIClient();
+
+private slots:
+ void slotStartInvitation();
+
+private:
+ MSNChatSession *m_manager;
+ NetMeetingPlugin *m_plugin;
+};
+
+#endif
+
+/*
+ * Local variables:
+ * c-indentation-style: k&r
+ * c-basic-offset: 8
+ * indent-tabs-mode: t
+ * End:
+ */
+// vim: set noet ts=4 sts=4 sw=4:
+
diff --git a/kopete/plugins/netmeeting/netmeetinginvitation.cpp b/kopete/plugins/netmeeting/netmeetinginvitation.cpp
new file mode 100644
index 00000000..191bc140
--- /dev/null
+++ b/kopete/plugins/netmeeting/netmeetinginvitation.cpp
@@ -0,0 +1,183 @@
+/*
+ msninvitation.cpp
+
+ Copyright (c) 2003 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 "netmeetinginvitation.h"
+
+#include "kopeteuiglobal.h"
+
+#include "msnchatsession.h"
+#include "msnswitchboardsocket.h"
+#include "msncontact.h"
+#include "kopetemetacontact.h"
+
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <kconfig.h>
+#include <kglobal.h>
+
+
+#include <qtimer.h>
+#include <kprocess.h>
+
+NetMeetingInvitation::NetMeetingInvitation(bool incoming, MSNContact *c, QObject *parent)
+ : QObject(parent) , MSNInvitation( incoming, NetMeetingInvitation::applicationID() , i18n("NetMeeting") )
+{
+ m_contact=c;
+ oki=false;
+}
+
+
+NetMeetingInvitation::~NetMeetingInvitation()
+{
+}
+
+
+QString NetMeetingInvitation::invitationHead()
+{
+ QTimer::singleShot( 10*60000, this, SLOT( slotTimeout() ) ); //send TIMEOUT in 10 minute if the invitation has not been accepted/refused
+ return QString( MSNInvitation::invitationHead()+
+ "Session-Protocol: SM1\r\n"
+ "Session-ID: {6672F94C-45BF-11D7-B4AE-00010A1008DF}\r\n" //FIXME i don't know what is the session id
+ "\r\n").utf8();
+}
+
+void NetMeetingInvitation::parseInvitation(const QString& msg)
+{
+ QRegExp rx("Invitation-Command: ([A-Z]*)");
+ rx.search(msg);
+ QString command=rx.cap(1);
+ if( msg.contains("Invitation-Command: INVITE") )
+ {
+ MSNInvitation::parseInvitation(msg); //for the cookie
+
+ unsigned int result = KMessageBox::questionYesNo( Kopete::UI::Global::mainWidget(),
+ i18n("%1 wants to start a chat with NetMeeting; do you want to accept it? " ).arg(m_contact->metaContact()->displayName()),
+ i18n("MSN Plugin") , i18n("Accept"),i18n("Refuse"));
+
+ MSNChatSession* manager=dynamic_cast<MSNChatSession*>(m_contact->manager());
+
+ if(manager && manager->service())
+ {
+ if(result==3) // Yes == 3
+ {
+ QCString message=QString(
+ "MIME-Version: 1.0\r\n"
+ "Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n"
+ "\r\n"
+ "Invitation-Command: ACCEPT\r\n"
+ "Invitation-Cookie: " + QString::number(cookie()) + "\r\n"
+ "Session-ID: {6672F94C-45BF-11D7-B4AE-00010A1008DF}\r\n" //FIXME
+ "Session-Protocol: SM1\r\n"
+ "Launch-Application: TRUE\r\n"
+ "Request-Data: IP-Address:\r\n"
+ "IP-Address: " + manager->service()->getLocalIP()+ "\r\n"
+ "\r\n" ).utf8();
+
+
+ manager->service()->sendCommand( "MSG" , "N", true, message );
+ oki=false;
+ QTimer::singleShot( 10* 60000, this, SLOT( slotTimeout() ) ); //TIMOUT afte 10 min
+ }
+ else //No
+ {
+ manager->service()->sendCommand( "MSG" , "N", true, rejectMessage() );
+ emit done(this);
+ }
+ }
+ }
+ else if( msg.contains("Invitation-Command: ACCEPT") )
+ {
+ if( ! incoming() )
+ {
+ MSNChatSession* manager=dynamic_cast<MSNChatSession*>(m_contact->manager());
+ if(manager && manager->service())
+ {
+ QCString message=QString(
+ "MIME-Version: 1.0\r\n"
+ "Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n"
+ "\r\n"
+ "Invitation-Command: ACCEPT\r\n"
+ "Invitation-Cookie: " + QString::number(cookie()) + "\r\n"
+ "Session-ID: {6672F94C-45BF-11D7-B4AE-00010A1008DF}\r\n" //FIXME: what is session id?
+ "Session-Protocol: SM1\r\n"
+ "Launch-Application: TRUE\r\n"
+ "Request-Data: IP-Address:\r\n"
+ "IP-Address: " + manager->service()->getLocalIP() + "\r\n"
+ "\r\n" ).utf8();
+ manager->service()->sendCommand( "MSG" , "N", true, message );
+ }
+ rx=QRegExp("IP-Address: ([0-9\\:\\.]*)");
+ rx.search(msg);
+ QString ip_address = rx.cap(1);
+ startMeeting(ip_address);
+ kdDebug() << k_funcinfo << ip_address << endl;
+ }
+ else
+ {
+ rx=QRegExp("IP-Address: ([0-9\\:\\.]*)");
+ rx.search(msg);
+ QString ip_address = rx.cap(1);
+
+ startMeeting(ip_address);
+ }
+ }
+ else //CANCEL
+ {
+ emit done(this);
+ }
+}
+
+void NetMeetingInvitation::slotTimeout()
+{
+ if(oki)
+ return;
+
+ MSNChatSession* manager=dynamic_cast<MSNChatSession*>(m_contact->manager());
+
+ if(manager && manager->service())
+ {
+ manager->service()->sendCommand( "MSG" , "N", true, rejectMessage("TIMEOUT") );
+ }
+ emit done(this);
+
+}
+
+
+void NetMeetingInvitation::startMeeting(const QString & ip_address)
+{
+ //TODO: use KProcess
+
+ KConfig *config=KGlobal::config();
+ config->setGroup("Netmeeting Plugin");
+ QString app=config->readEntry("NetmeetingApplication","ekiga -c callto://%1").arg(ip_address);
+
+ kdDebug() << k_funcinfo << app << endl ;
+
+ QStringList args=QStringList::split(" ", app);
+
+ KProcess p;
+ for(QStringList::Iterator it=args.begin() ; it != args.end() ; ++it)
+ {
+ p << *it;
+ }
+ p.start();
+}
+
+#include "netmeetinginvitation.moc"
+
+
+
+
diff --git a/kopete/plugins/netmeeting/netmeetinginvitation.h b/kopete/plugins/netmeeting/netmeetinginvitation.h
new file mode 100644
index 00000000..0fbaf318
--- /dev/null
+++ b/kopete/plugins/netmeeting/netmeetinginvitation.h
@@ -0,0 +1,56 @@
+/*
+ netmeetinginvitation.cpp
+
+ Copyright (c) 2003 by Olivier Goffart <ogoffart @ kde.org>
+
+ Kopete (c) 2003 by the Kopete developers <[email protected]>
+
+ *************************************************************************
+ * *
+ * 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. *
+ * *
+ *************************************************************************
+*/
+#ifndef MSNVOICEINVITATION_H
+#define MSNVOICEINVITATION_H
+
+#include <qobject.h>
+#include "msninvitation.h"
+
+class MSNContact;
+
+/**
+ *@author Olivier Goffart
+ */
+class NetMeetingInvitation : public QObject , public MSNInvitation
+{
+Q_OBJECT
+public:
+ NetMeetingInvitation(bool incoming ,MSNContact*, QObject *parent = 0);
+ ~NetMeetingInvitation();
+
+ static QString applicationID() { return "44BBA842-CC51-11CF-AAFA-00AA00B6015C"; }
+ QString invitationHead();
+
+ virtual void parseInvitation(const QString& invitation);
+
+ virtual QObject* object() { return this; }
+
+signals:
+ void done( MSNInvitation * );
+
+private slots:
+ void slotTimeout();
+
+private:
+ MSNContact *m_contact;
+ bool oki;
+ void startMeeting(const QString & ip_address);
+
+};
+
+
+#endif
diff --git a/kopete/plugins/netmeeting/netmeetingplugin.cpp b/kopete/plugins/netmeeting/netmeetingplugin.cpp
new file mode 100644
index 00000000..d2ea501c
--- /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 <kaction.h>
+#include <kdeversion.h>
+#include <kaboutdata.h>
+
+#include "kopetepluginmanager.h"
+#include "kopetechatsessionmanager.h"
+
+#include "msnchatsession.h"
+#include "msnprotocol.h"
+#include "msncontact.h"
+
+#include "netmeetinginvitation.h"
+#include "netmeetingguiclient.h"
+
+
+static const KAboutData aboutdata("kopete_netmeeting", I18N_NOOP("NetMeeting") , "1.0" );
+K_EXPORT_COMPONENT_FACTORY( kopete_netmeeting, KGenericFactory<NetMeetingPlugin>( &aboutdata ) )
+
+NetMeetingPlugin::NetMeetingPlugin( QObject *parent, const char *name, const QStringList &/*args*/ )
+: Kopete::Plugin( KGlobal::instance(), parent, name )
+{
+ if(MSNProtocol::protocol())
+ slotPluginLoaded(MSNProtocol::protocol());
+ else
+ connect(Kopete::PluginManager::self() , SIGNAL(pluginLoaded(Kopete::Plugin*) ), this, SLOT(slotPluginLoaded(Kopete::Plugin*)));
+
+
+ connect( Kopete::ChatSessionManager::self(), SIGNAL( chatSessionCreated( Kopete::ChatSession * )) , SLOT( slotNewKMM( Kopete::ChatSession * ) ) );
+ //Add GUI action to all already existing kmm (if the plugin is launched when kopete already rining)
+ QValueList<Kopete::ChatSession*> sessions = Kopete::ChatSessionManager::self()->sessions();
+ for (QValueListIterator<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 , SIGNAL(invitation(MSNInvitation*& , const QString & , long unsigned int , MSNChatSession* , MSNContact* )) ,
+ this, SLOT( slotInvitation(MSNInvitation*& , const QString & , long unsigned int , MSNChatSession* , MSNContact* )));
+ }
+}
+
+void NetMeetingPlugin::slotNewKMM(Kopete::ChatSession *KMM)
+{
+ MSNChatSession *msnMM=dynamic_cast<MSNChatSession*>(KMM);
+ if(msnMM)
+ {
+ connect(this , SIGNAL( destroyed(QObject*)) ,
+ new NetMeetingGUIClient(msnMM)
+ , SLOT(deleteLater()));
+ }
+}
+
+
+void NetMeetingPlugin::slotInvitation(MSNInvitation*& invitation, const QString &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"
diff --git a/kopete/plugins/netmeeting/netmeetingplugin.h b/kopete/plugins/netmeeting/netmeetingplugin.h
new file mode 100644
index 00000000..7427bbf8
--- /dev/null
+++ b/kopete/plugins/netmeeting/netmeetingplugin.h
@@ -0,0 +1,46 @@
+/*
+ netmeetingplugin.h
+
+ Copyright (c) 2003 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. *
+ * *
+ *************************************************************************
+*/
+
+
+
+#ifndef NetMeetingPLUGIN_H
+#define NetMeetingPLUGIN_H
+
+#include "kopeteplugin.h"
+
+namespace Kopete { class ChatSession; }
+class MSNChatSession;
+class MSNContact;
+class MSNInvitation;
+
+
+class NetMeetingPlugin : public Kopete::Plugin
+{
+ Q_OBJECT
+
+public:
+ NetMeetingPlugin( QObject *parent, const char *name, const QStringList &args );
+ ~NetMeetingPlugin();
+
+private slots:
+ void slotNewKMM(Kopete::ChatSession *);
+ void slotPluginLoaded(Kopete::Plugin*);
+ void slotInvitation(MSNInvitation*& invitation, const QString &bodyMSG , long unsigned int cookie , MSNChatSession* msnMM , MSNContact* c );
+
+
+};
+
+#endif
+
diff --git a/kopete/plugins/netmeeting/netmeetingpreferences.cpp b/kopete/plugins/netmeeting/netmeetingpreferences.cpp
new file mode 100644
index 00000000..b28dfe09
--- /dev/null
+++ b/kopete/plugins/netmeeting/netmeetingpreferences.cpp
@@ -0,0 +1,81 @@
+/***************************************************************************
+ Netmeetingpreferences.cpp - description
+ -------------------
+ copyright : (C) 2004 by Olivier Goffart
+ email : 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 <qlayout.h>
+#include <qcheckbox.h>
+
+#include <kcombobox.h>
+#include <klineedit.h>
+#include <kparts/componentfactory.h>
+#include <klocale.h>
+#include <kconfig.h>
+#include <kglobal.h>
+#include <kcombobox.h>
+#include <klistview.h>
+#include <kgenericfactory.h>
+#include <kcolorbutton.h>
+#include <kinputdialog.h>
+#include <kurlrequester.h>
+#include <kregexpeditorinterface.h>
+#include <kdebug.h>
+
+#include "netmeetingplugin.h"
+#include "netmeetingprefs_ui.h"
+#include "netmeetingpreferences.h"
+
+typedef KGenericFactory<NetmeetingPreferences> NetmeetingPreferencesFactory;
+K_EXPORT_COMPONENT_FACTORY( kcm_kopete_netmeeting, NetmeetingPreferencesFactory( "kcm_kopete_netmeeting" ) )
+
+NetmeetingPreferences::NetmeetingPreferences(QWidget *parent, const char* /*name*/, const QStringList &args)
+ : KCModule(NetmeetingPreferencesFactory::instance(), parent, args)
+{
+ ( new QVBoxLayout( this ) )->setAutoAdd( true );
+ preferencesDialog = new NetmeetingPrefsUI(this);
+
+ connect(preferencesDialog->m_app , SIGNAL(textChanged(const QString &)) , this , SLOT(slotChanged()));
+
+ load();
+}
+
+NetmeetingPreferences::~NetmeetingPreferences()
+{
+}
+
+void NetmeetingPreferences::load()
+{
+ KConfig *config=KGlobal::config();
+ config->setGroup("Netmeeting Plugin");
+ preferencesDialog->m_app->setCurrentText(config->readEntry("NetmeetingApplication","ekiga -c callto://%1"));
+ emit KCModule::changed(false);
+}
+
+void NetmeetingPreferences::save()
+{
+ KConfig *config=KGlobal::config();
+ config->setGroup("Netmeeting Plugin");
+ config->writeEntry("NetmeetingApplication",preferencesDialog->m_app->currentText());
+ emit KCModule::changed(false);
+}
+
+
+void NetmeetingPreferences::slotChanged()
+{
+ emit KCModule::changed(true);
+}
+
+#include "netmeetingpreferences.moc"
+
+// vim: set noet ts=4 sts=4 sw=4:
diff --git a/kopete/plugins/netmeeting/netmeetingpreferences.h b/kopete/plugins/netmeeting/netmeetingpreferences.h
new file mode 100644
index 00000000..94a7031e
--- /dev/null
+++ b/kopete/plugins/netmeeting/netmeetingpreferences.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ netmeetingpreferences.h - description
+ -------------------
+ copyright : (C) 2004 by Olivier Goffart
+ email : 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. *
+ * *
+ ***************************************************************************/
+
+#ifndef NetmeetingPREFERENCES_H
+#define NetmeetingPREFERENCES_H
+
+#include <kcmodule.h>
+#include <qstring.h>
+
+class NetmeetingPrefsUI;
+
+/**
+ *@author Olivier Goffart
+ */
+
+class NetmeetingPreferences : public KCModule {
+ Q_OBJECT
+public:
+
+ NetmeetingPreferences(QWidget *parent = 0, const char* name = 0, const QStringList &args = QStringList());
+ ~NetmeetingPreferences();
+
+ virtual void save();
+ virtual void load();
+
+private:
+ NetmeetingPrefsUI *preferencesDialog;
+
+private slots:
+ void slotChanged();
+};
+
+#endif
diff --git a/kopete/plugins/netmeeting/netmeetingprefs_ui.ui b/kopete/plugins/netmeeting/netmeetingprefs_ui.ui
new file mode 100644
index 00000000..ed84eb6b
--- /dev/null
+++ b/kopete/plugins/netmeeting/netmeetingprefs_ui.ui
@@ -0,0 +1,148 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>NetmeetingPrefsUI</class>
+<author>Olivier Goffart</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>424</width>
+ <height>297</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>The NetMeeting Plugin allows you to start a video or voice chat with your MSN Messenger contacts.
+
+This is not the same as webcam chat you can find in the newer Windows Messenger®, but uses the older NetMeeting chat you can find in old versions.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Application to launch:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox">
+ <item>
+ <property name="text">
+ <string>ekiga -c callto://%1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>konference callto://%1</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_app</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="autoCompletion">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;%1&lt;/b&gt; will be replaced by the ip to call</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>60</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KActiveLabel">
+ <property name="name">
+ <cstring>kActiveLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>You can download Konference here: &lt;a href="http://www.kde-apps.org/content/show.php?content=10395"&gt;http://www.kde-apps.org/content/show.php?content=10395&lt;/a&gt;</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kactivelabel.h</includehint>
+</includehints>
+</UI>