2 wlmsocket.cpp - Kopete Wlm Protocol
4 Copyright (c) 2008 by Tiago Salem Herrmann <tiagosh@gmail.com>
5 Kopete (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>
7 *************************************************************************
9 * This library is free software; you can redistribute it and/or *
10 * modify it under the terms of the GNU General Public *
11 * License as published by the Free Software Foundation; either *
12 * version 2 of the License, or (at your option) any later version. *
14 *************************************************************************
17 #include "wlmsocket.h"
21 WlmSocket::WlmSocket (MSN::NotificationServerConnection
* mainConnection
, bool isSSL
) :
25 this->mainConnection
= mainConnection
;
27 QObject::connect (this, SIGNAL (connected ()), this,
28 SLOT (connectionReady ()));
29 QObject::connect (this, SIGNAL (disconnected ()), this,
30 SLOT (connectionFinished ()));
31 QObject::connect (this, SIGNAL (encrypted ()), this,
32 SLOT (connectionEncryptedReady()));
37 WlmSocket::connectionEncryptedReady()
43 // Retrieve the connection associated with the
44 // socket's file handle on which the event has
46 c
= mainConnection
->connectionWithSocket ((void*)this);
48 // if this is a libmsn socket
51 if (c
->isConnected () == false)
53 c
->socketConnectionCompleted ();
55 // If this event is due to new data becoming available
56 c
->socketIsWritable ();
62 WlmSocket::connectionReady ()
66 // ssl is connected when encrypted() is raised
72 // Retrieve the connection associated with the
73 // socket's file handle on which the event has
75 c
= mainConnection
->connectionWithSocket ((void*)this);
77 // if this is a libmsn socket
80 if (c
->isConnected () == false)
82 c
->socketConnectionCompleted ();
84 // If this event is due to new data becoming available
85 c
->socketIsWritable ();
90 WlmSocket::connectionFinished ()
95 WlmSocket::incomingData ()
102 // Retrieve the connection associated with the
103 // socket's file handle on which the event has
105 c
= mainConnection
->connectionWithSocket ((void*)this);
107 // if this is a libmsn socket
110 if (c
->isConnected () == false)
112 c
->socketConnectionCompleted ();
114 // If this event is due to new data becoming available
115 c
->dataArrivedOnSocket ();
119 WlmSocket::~WlmSocket ()
123 #include "wlmsocket.moc"