[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/protocols/qq
From:       Hui Jin <blueangel.jin () gmail ! com>
Date:       2006-08-30 18:17:56
Message-ID: 1156961876.364088.15318.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 578983 by blueangel:

Clarifiy contactInfo and contactDetail:
contactInfo returns the POD, just the brief information.
contactDetail returns std::list<std::string> for detailed information.



 M  +2 -2      libeva.cpp  
 M  +3 -3      libeva.h  
 M  +11 -13    qqnotifysocket.cpp  
 M  +1 -1      qqnotifysocket.h  


--- trunk/KDE/kdenetwork/kopete/protocols/qq/libeva.cpp #578982:578983
@@ -287,12 +287,12 @@
 		return Packet::create(id, ChangeStatus, sequence, key, text );
 	}
 
-	ByteArray contactInfo( uint id, ushort sequence, const ByteArray& key, int qqId )
+	ByteArray contactDetail( uint id, ushort sequence, const ByteArray& key, int qqId )
 	{
 		ByteArray text(32);
 		snprintf( text.c_str(), 31, "%d", qqId );
 		text.setSize( strlen( text.c_str() ) );
-		return Packet::create(id, UserInfo, sequence, key, text );
+		return Packet::create(id, ContactDetail, sequence, key, text );
 	}
 
 	ByteArray groupNames( uint id, ushort sequence, const ByteArray& key )
--- trunk/KDE/kdenetwork/kopete/protocols/qq/libeva.h #578982:578983
@@ -27,7 +27,7 @@
 	static const ushort Heartbeat = 0x0002;
 	static const ushort UpdateInfo = 0x0004;
 	static const ushort Search = 0x0005;
-	static const ushort UserInfo = 0x0006;
+	static const ushort ContactDetail = 0x0006;
 	static const ushort AddFriend = 0x0009;
 	static const ushort RemoveFriend = 0x000A;
 	static const ushort AuthInvite = 0x000B;
@@ -415,9 +415,9 @@
 	 */
 	ByteArray statusUpdate( uint id, ushort sequence, const ByteArray& key, uchar status );
 	/** 
-	 * Fetch user information of qqId
+	 * Fetch contact information of qqId
 	 */
-	ByteArray contactInfo( uint id, ushort sequence, const ByteArray& key, int qqId );
+	ByteArray contactDetail( uint id, ushort sequence, const ByteArray& key, int qqId );
 	/**
 	 * request transfer key, which is used as the identification of the conversation
 	 */
--- trunk/KDE/kdenetwork/kopete/protocols/qq/qqnotifysocket.cpp #578982:578983
@@ -144,17 +144,15 @@
 			break;
 		case Eva::UpdateInfo :
 		case Eva::Search :
-		case Eva::UserInfo :
+		case Eva::ContactDetail :
 		{
-			std::list<std::string> cd = Eva::Packet::contactDetail(text);
-			// dump it
-			kDebug(14140) << "dump the contact info" << endl;
-			for( std::list<std::string>::const_iterator it = cd.begin(); 
-				it != cd.end(); it++ )
-			{
-				kDebug(14140) << QString((*it).c_str()) << endl;
-			}
-			break;
+			std::list<std::string> list = Eva::Packet::contactDetail(text);
+			QStringList qsl;
+			for( std::list<std::string>::const_iterator it = list.begin(); 
+				it != list.end(); it++ )
+				qsl.push_back( QString((*it).c_str()) );
+
+			// emit Contact
 		}
 
 			
@@ -288,7 +286,7 @@
 					sendPacket( Eva::transferKey( m_qqId, m_id++, m_sessionKey) );
 
 					// get the meta data for myself
-					contactInfo(m_qqId);
+					contactDetail(m_qqId);
 
 					// fetch the online contacts
 					sendListOnlineContacts();
@@ -381,9 +379,9 @@
 }
 
 
-void QQNotifySocket::contactInfo(Eva::uint qqId)
+void QQNotifySocket::contactDetail(Eva::uint qqId)
 {
-	sendPacket( Eva::contactInfo( m_qqId, m_id++, m_sessionKey, qqId) );
+	sendPacket( Eva::contactDetail( m_qqId, m_id++, m_sessionKey, qqId) );
 }
 	
 void QQNotifySocket::sendTextMessage( const uint toId, const QByteArray& message )
--- trunk/KDE/kdenetwork/kopete/protocols/qq/qqnotifysocket.h #578982:578983
@@ -105,7 +105,7 @@
 	void sendListOnlineContacts(uint pos = 0);
 	void sendMsgReply( int sequence, const Eva::ByteArray& replyKey );
 	void heartbeat();
-	void contactInfo(Eva::uint qqId);
+	void contactDetail(Eva::uint qqId);
 
 private:
 	QQAccount *m_account;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic