[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/soc-kopete-jingle/kopete/protocols/jabber
From: Detlev Casanova <detlev.casanova () gmail ! com>
Date: 2008-10-17 12:46:52
Message-ID: 1224247612.305383.9466.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 872546 by casanova:
* Better names for some slots;
* Fixed crash when A session is started after one session has been terminated \
("terminated()" signal connected in both cases);
* Added and fixed some comments.
M +0 -42 jabbercontact.cpp
M +4 -5 jingle/alsaio.cpp
M +2 -2 jingle/alsaio.h
M +8 -5 libiris/iris/jabber/jinglesessionmanager.cpp
M +5 -3 libiris/iris/jabber/jingletasks.cpp
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jabbercontact.cpp \
#872545:872546 @@ -61,15 +61,6 @@
#include "jabbertransport.h"
#include "dlgjabbervcard.h"
-#undef SUPPORT_JINGLE //Jingle support Hardly disabled
-
-#ifdef SUPPORT_JINGLE
- #include "jinglesessionmanager.h"
- #include "jinglevoicesession.h"
- #include "jinglevoicesessiondialog.h"
-#endif
-//#include "jinglesession.h"
-//#include "jingletasks.h"
#include "jinglecallsmanager.h"
/**
@@ -1265,39 +1256,6 @@
return mLastReceivedMessageId;
}
-#ifdef SUPPORT_JINGLE
-void JabberContact::voiceCall( )
-{
- Jid jid = mRosterItem.jid();
-
- // It's honor lock by default.
- JabberResource *bestResource = account()->resourcePool()->bestJabberResource( jid \
);
- if( bestResource )
- {
- if( jid.resource().isEmpty() )
- {
- // If the jid resource is empty, get the JID from best resource for this contact.
- jid = bestResource->jid();
- }
- //TODO iterate through resources until we find one that supports voice
- if( account()->sessionManager() && bestResource->features().canVoice() )
- {
- JingleVoiceSession *session = \
static_cast<JingleVoiceSession*>(account()->sessionManager()->createSession("http://www.google.com/session/phone", \
jid));
-
- JingleVoiceSessionDialog *voiceDialog = new JingleVoiceSessionDialog(session);
- voiceDialog->show();
- voiceDialog->start();
- }else{
- KMessageBox::sorry(0,i18n("The contact you selected does not have a jabber \
resource with voice support right now."), i18n("Unable to make voice \
call"));
- }
- }
- else
- {
- // Shouldn't ever go here.
- }
-}
-#endif
-
void JabberContact::slotDiscoFinished( )
{
mDiscoDone = true;
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/alsaio.cpp \
#872545:872546 @@ -347,7 +347,7 @@
//Always use the first pollfd
notifier = new QSocketNotifier(ufds[0].fd, QSocketNotifier::Read, this);
notifier->setEnabled(true);
- connect(notifier, SIGNAL(activated(int)), this, SLOT(slotActivated(int)));
+ connect(notifier, SIGNAL(activated(int)), this, SLOT(slotReadyRead(int)));
snd_pcm_start(handle);
}
else if (m_type == Playback)
@@ -372,7 +372,7 @@
notifier = new QSocketNotifier(ufds[0].fd, type);
notifier->setEnabled(false); //Will be activated as soon as data comes in
- connect(notifier, SIGNAL(activated(int)), this, SLOT(checkAlsaPoll(int)));
+ connect(notifier, SIGNAL(activated(int)), this, SLOT(slotReadyWrite(int)));
qDebug() << "Time stamp =" << timeStamp();
}
kDebug() << "started.";
@@ -436,11 +436,10 @@
return ts;
}
-void AlsaIO::slotActivated(int) //Rename this slot
+void AlsaIO::slotReadyRead(int)
{
//qDebug() << "Data arrived. (Alsa told me !)";
size_t size;
- //buf.clear();
buf.resize(pSizeBytes);
size = snd_pcm_readi(handle, buf.data(), pSize);
@@ -449,7 +448,7 @@
emit readyRead();
}
-void AlsaIO::checkAlsaPoll(int)
+void AlsaIO::slotReadyWrite(int)
{
//qDebug() << "started since" << (times * periodTime()) / 1000 << "sec.";
//times++;
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/alsaio.h \
#872545:872546 @@ -134,8 +134,8 @@
int frameSizeBytes();
public slots:
- void slotActivated(int socket);
- void checkAlsaPoll(int);
+ void slotReadyRead(int socket);
+ void slotReadyWrite(int socket);
signals:
void readyRead();
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/libiris/iris/jabber/jinglesessionmanager.cpp \
#872545:872546 @@ -166,8 +166,10 @@
void JingleSessionManager::slotSessionIncoming()
{
qDebug() << "JingleSessionManager::slotSessionIncoming() called.";
+
JingleSession *sess = d->pjs->takeNextIncomingSession();
d->sessions << sess;
+ connect(sess, SIGNAL(terminated()), this, SLOT(slotSessionTerminated()));
// TODO:Check if the Transport method is supported.
for (int i = 0; i < sess->contents().count(); i++)
@@ -180,26 +182,27 @@
//I think we have to send a no payload supported stanza.
//sess->terminate(UnsupportedApplications);
//--> no, only if all transports are unsupported
- //in this case, a content-remove is more appropriate.
+ //in this case, a content-remove MUST be sent.
return;
}
if (!checkSupportedTransport(c))
{
- //I think we have to send a no payload supported stanza.
+ //I think we have to send a no transport supported stanza.
//sess->terminate(UnsupportedTransports);
//--> no, only if all applications are unsupported
- //in this case, a content-remove is more appropriate.
+ //in this case, a content-remove MUST be sent.
return;
}
//Set supported payloads for this content.
c->setPayloadTypes(c->type() == JingleContent::Audio ? d->supportedAudioPayloads : \
d->supportedVideoPayloads); }
+
emit newJingleSession(sess);
- qDebug() << "SEND RINGING.";
+
d->sessions.last()->ring();
- qDebug() << "START NEGOTIATION";
+
d->sessions.last()->startNegotiation();
}
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/libiris/iris/jabber/jingletasks.cpp \
#872545:872546 @@ -628,11 +628,13 @@
jingle.setAttribute("sid", d->session->sid());
//---------This par should be in another method (createJingleIQ(...))
QDomElement received = doc()->createElement("received");
- received.setAttribute("xmlns", "urn:xmpp:tmp:jingle:transports:ice-udp:info");
+
+ //That depends of the session content's transport.
+ //Ice-udp does not need the "receive" informationnal message.
+ received.setAttribute("xmlns", "urn:xmpp:tmp:jingle:transports:raw-udp:info");
+
jingle.appendChild(received);
d->iq.appendChild(jingle);
-
- //send(d->iq);
}
void JT_JingleAction::sessionAccept(const QList<JingleContent*>& contents)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic