[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/kopete/dev-0.12/kopete/protocols/oscar/aim
From: Matt Rogers <mattr () kde ! org>
Date: 2005-09-30 20:51:48
Message-ID: 1128113508.918759.26086.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 465788 by mattr:
windows are now opened for chat rooms
M +21 -1 aimaccount.cpp
M +1 -0 aimaccount.h
M +3 -0 aimchatsession.cpp
--- branches/work/kopete/dev-0.12/kopete/protocols/oscar/aim/aimaccount.cpp \
#465787:465788 @@ -31,6 +31,7 @@
#include "kopetemetacontact.h"
#include "kopeteprotocol.h"
#include "kopetechatsessionmanager.h"
+#include "kopeteview.h"
#include <kopeteuiglobal.h>
#include "aimprotocol.h"
@@ -77,7 +78,21 @@
return m_profileString;
}
+Kopete::ChatSession* AIMMyselfContact::manager( Kopete::Contact::CanCreateFlags \
canCreate ) +{
+ Kopete::ContactPtrList chatMembers;
+ chatMembers.append( this );
+ Kopete::ChatSession* genericManager = 0L;
+ genericManager = Kopete::ChatSessionManager::self()->findChatSession( \
account()->myself(), chatMembers, protocol() ); + AIMChatSession* session = \
dynamic_cast<AIMChatSession*>( genericManager );
+ if ( !session && canCreate == Contact::CanCreate )
+ session = new AIMChatSession( this, chatMembers, account()->protocol() );
+
+ return session;
+}
+
+
AIMAccount::AIMAccount(Kopete::Protocol *parent, QString accountID, const char \
*name) : OscarAccount(parent, accountID, name, false)
{
@@ -437,9 +452,14 @@
{
kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Creating chat room session" << endl;
Kopete::ContactPtrList emptyList;
- AIMChatSession* session = new AIMChatSession( myself(), emptyList, protocol() );
+ AIMChatSession* session = dynamic_cast<AIMChatSession*>( myself()->manager( \
Kopete::Contact::CannotCreate ) ); + if ( !session )
+ session = dynamic_cast<AIMChatSession*>( myself()->manager( \
Kopete::Contact::CanCreate ) ); +
session->setExchange( exchange );
session->setRoomName( room );
+ if ( session->view( true ) )
+ session->raiseView();
}
void AIMAccount::userJoinedChat( WORD exchange, const QString& room, const QString& \
contact )
--- branches/work/kopete/dev-0.12/kopete/protocols/oscar/aim/aimaccount.h \
#465787:465788 @@ -50,6 +50,7 @@
void setLastAwayMessage( const QString& msg) {m_lastAwayMessage = msg;}
QString lastAwayMessage() { return m_lastAwayMessage; };
+ virtual Kopete::ChatSession* manager( Kopete::Contact::CanCreateFlags = \
Kopete::Contact::CannotCreate ); private:
QString m_profileString;
AIMAccount* m_acct;
--- branches/work/kopete/dev-0.12/kopete/protocols/oscar/aim/aimchatsession.cpp \
#465787:465788 @@ -21,12 +21,15 @@
#include "aimchatsession.h"
#include "kopetecontact.h"
#include "kopetechatsessionmanager.h"
+#include "kopeteprotocol.h"
AIMChatSession::AIMChatSession( const Kopete::Contact* user, Kopete::ContactPtrList \
others, Kopete::Protocol* protocol )
: Kopete::ChatSession( user, others, protocol, "AIMChatSession" )
{
Kopete::ChatSessionManager::self()->registerChatSession( this );
+ setInstance( protocol->instance() );
+ setMayInvite( false );
}
QString AIMChatSession::roomName() const
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic