summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/oscar/liboscar/logintask.cpp
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2019-12-10 01:24:17 +0100
committerSlávek Banko <[email protected]>2019-12-10 18:54:30 +0100
commitdd43402365ac82e6f28d373ea857a38f473e9f45 (patch)
tree8a4825ac0df9d8f1f3f3685a9e0fd5f96d5e274d /kopete/protocols/oscar/liboscar/logintask.cpp
parent3ca6259d5b5b41ecce9759373714bdc57ff563d8 (diff)
downloadtdenetwork-dd43402365ac82e6f28d373ea857a38f473e9f45.tar.gz
tdenetwork-dd43402365ac82e6f28d373ea857a38f473e9f45.zip
kopete: Restore the AIM protocol because a replacement AIM server was created.
This reverts commits 036b0229db and dc34f9c391. Signed-off-by: Slávek Banko <[email protected]> (cherry picked from commit 91ba38a1df42b56caa73babc90ffa4f674c000d4)
Diffstat (limited to 'kopete/protocols/oscar/liboscar/logintask.cpp')
-rw-r--r--kopete/protocols/oscar/liboscar/logintask.cpp52
1 files changed, 43 insertions, 9 deletions
diff --git a/kopete/protocols/oscar/liboscar/logintask.cpp b/kopete/protocols/oscar/liboscar/logintask.cpp
index c3d568f9..73379e40 100644
--- a/kopete/protocols/oscar/liboscar/logintask.cpp
+++ b/kopete/protocols/oscar/liboscar/logintask.cpp
@@ -1,6 +1,6 @@
/*
Kopete Oscar Protocol
- logintask.cpp - Handles logging into to the ICQ service
+ logintask.cpp - Handles logging into to the AIM or ICQ service
Copyright (c) 2004 Matt Rogers <[email protected]>
@@ -22,6 +22,7 @@
#include <kdebug.h>
#include <tdelocale.h>
+#include "aimlogintask.h"
#include "connection.h"
#include "closeconnectiontask.h"
#include "icqlogintask.h"
@@ -39,26 +40,49 @@
StageOneLoginTask::StageOneLoginTask( Task* parent )
: Task ( parent )
{
+ m_aimTask = 0L;
m_icqTask = 0L;
m_closeTask = 0L;
}
StageOneLoginTask::~StageOneLoginTask()
{
+ delete m_aimTask;
delete m_icqTask;
delete m_closeTask;
}
bool StageOneLoginTask::take( Transfer* transfer )
{
- if ( forMe( transfer ) ) {
- kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Starting ICQ login" << endl;
- m_icqTask = new IcqLoginTask( client()->rootTask() );
- m_closeTask = new CloseConnectionTask( client()->rootTask() );
-
- //connect finished signal
- connect( m_closeTask, TQT_SIGNAL( finished() ), this, TQT_SLOT( closeTaskFinished() ) );
- m_icqTask->go( true );
+ if ( forMe( transfer ) )
+ {
+ if ( client()->isIcq() )
+ {
+ kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Starting ICQ login" << endl;
+ m_icqTask = new IcqLoginTask( client()->rootTask() );
+ m_closeTask = new CloseConnectionTask( client()->rootTask() );
+
+ //connect finished signal
+ connect( m_closeTask, TQT_SIGNAL( finished() ), this, TQT_SLOT( closeTaskFinished() ) );
+ m_icqTask->go( true );
+ }
+ else
+ {
+ kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Starting AIM login" << endl;
+ kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Sending the FLAP version back" << endl;
+
+ //send the flap version response
+ FLAP f = { 0x01, 0 , 0 };
+ Buffer *outbuf = new Buffer;
+ outbuf->addDWord(0x00000001); //flap version
+ f.length = outbuf->length();
+ Transfer* ft = createTransfer( f, outbuf );
+ send( ft );
+
+ m_aimTask = new AimLoginTask( client()->rootTask() );
+ connect( m_aimTask, TQT_SIGNAL( finished() ), this, TQT_SLOT( aimTaskFinished() ) );
+ m_aimTask->go( true );
+ }
return true;
}
return false;
@@ -74,6 +98,16 @@ void StageOneLoginTask::closeTaskFinished()
setSuccess( m_closeTask->statusCode(), m_closeTask->statusString() );
}
+void StageOneLoginTask::aimTaskFinished()
+{
+ kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << endl;
+ m_cookie = m_aimTask->cookie();
+ m_bosPort = m_aimTask->bosPort();
+ m_bosServer = m_aimTask->bosHost();
+
+ setSuccess( m_aimTask->statusCode(), m_aimTask->statusString() );
+}
+
bool StageOneLoginTask::forMe( Transfer* transfer ) const
{
FlapTransfer* ft = dynamic_cast<FlapTransfer*> ( transfer );