[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-22 21:31:32
Message-ID: 1156282292.405489.23110.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 576027 by blueangel:
Update the function parameters:
add const decorator to ByteArray key.
remove const decorator for int, short, uchar.
M +16 -16 libeva.cpp
M +14 -14 libeva.h
M +2 -2 qqnotifysocket.cpp
M +2 -2 qqnotifysocket.h
--- trunk/KDE/kdenetwork/kopete/protocols/qq/libeva.cpp #576026:576027
@@ -40,7 +40,7 @@
}
- ByteArray header( int id, short const command, short const sequence )
+ ByteArray header( uint id, short const command, ushort sequence )
{
// CODE DEBT: udp does not have the lenght placeholder!
ByteArray data(13);
@@ -55,7 +55,7 @@
return data;
}
- ByteArray messageHeader( int sender, int receiver, const ByteArray& transferKey, \
short const type, short const sequence, int const timestamp, short const face = 0 ) \
+ ByteArray messageHeader( int sender, int receiver, const ByteArray& transferKey, \
short const type, ushort sequence, int const timestamp, short const face = 0 ) {
// CODE DEBT: udp does not have the lenght placeholder!
ByteArray data(64);
@@ -133,7 +133,7 @@
ByteArray encrypt( const ByteArray& text, const ByteArray& key );
- ByteArray buildPacket( int id, short const command, short const sequence, const \
ByteArray& key, const ByteArray& text ) + ByteArray buildPacket( uint id, short const \
command, ushort sequence, const ByteArray& key, const ByteArray& text ) {
ByteArray packet(MaxPacketLength);
packet += header( id, command, sequence );
@@ -204,7 +204,7 @@
// Core functions
- ByteArray requestLoginToken( int id, short const sequence )
+ ByteArray requestLoginToken( uint id, ushort sequence )
{
ByteArray data(16);
data += header(id, RequestLoginToken, sequence);
@@ -215,8 +215,8 @@
return data;
}
- ByteArray login( int id, short const sequence, const ByteArray& key,
- const ByteArray& token, char const loginMode )
+ ByteArray login( uint id, ushort sequence, const ByteArray& key,
+ const ByteArray& token, uchar loginMode )
{
ByteArray login(LoginLength);
ByteArray data(MaxPacketLength);
@@ -244,7 +244,7 @@
return data;
}
- ByteArray requestTransferKey( int id, short const sequence, const ByteArray& key )
+ ByteArray requestTransferKey( uint id, ushort sequence, const ByteArray& key )
{
ByteArray text(1);
text += TransferKey;
@@ -252,7 +252,7 @@
return buildPacket(id, RequestKey, sequence, key, text );
}
- ByteArray contactList( int id, short const sequence, const ByteArray& key, short \
pos ) + ByteArray contactList( uint id, ushort sequence, const ByteArray& key, short \
pos ) {
ByteArray text(5);
text += pos;
@@ -264,7 +264,7 @@
return buildPacket(id, ContactList, sequence, key, text );
}
- ByteArray changeStatus( int id, short const sequence, ByteArray& key, char status )
+ ByteArray changeStatus( uint id, ushort sequence, const ByteArray& key, char status \
) {
ByteArray text(5);
text += status;
@@ -272,7 +272,7 @@
return buildPacket(id, ChangeStatus, sequence, key, text );
}
- ByteArray userInfo( int id, short const sequence, ByteArray& key, int qqId )
+ ByteArray userInfo( uint id, ushort sequence, const ByteArray& key, int qqId )
{
ByteArray text(20);
snprintf( text.c_str(), 19, "%d", qqId );
@@ -280,7 +280,7 @@
return buildPacket(id, UserInfo, sequence, key, text );
}
- ByteArray getGroupNames( int id, short const sequence, ByteArray& key )
+ ByteArray getGroupNames( uint id, ushort sequence, const ByteArray& key )
{
ByteArray text(6);
text += DownloadGroupNames;
@@ -290,7 +290,7 @@
return buildPacket(id, GroupNames, sequence, key, text );
}
- ByteArray downloadGroups( int id, short const sequence, ByteArray& key, int pos )
+ ByteArray downloadGroups( uint id, ushort sequence, const ByteArray& key, int pos )
{
ByteArray text(10);
text += '\1';
@@ -301,7 +301,7 @@
return buildPacket(id, DownloadGroups, sequence, key, text );
}
- ByteArray textMessage( int id, short const sequence, ByteArray& key,
+ ByteArray textMessage( uint id, ushort sequence, const ByteArray& key,
// Here are the message variables:
int toId, const ByteArray& transferKey, ByteArray& message )
{
@@ -311,19 +311,19 @@
return buildPacket(id, SendMsg, sequence, key, text );
}
- ByteArray messageReply(int id, short const sequence, ByteArray& key, const \
ByteArray& text ) + ByteArray messageReply(uint id, ushort sequence, const ByteArray& \
key, const ByteArray& text ) {
return buildPacket(id, ReceiveMsg, sequence, key, text );
}
- ByteArray heartbeat(int id, short const sequence, ByteArray& key )
+ ByteArray heartbeat(uint id, ushort sequence, const ByteArray& key )
{
ByteArray text(4);
text += id;
return buildPacket(id, Heartbeat, sequence, key, text );
}
- ByteArray onlineContacts(int id, short const sequence, const ByteArray& key, uchar \
pos ) + ByteArray onlineContacts(uint id, ushort sequence, const ByteArray& key, \
uchar pos ) {
ByteArray text(5);
text += uchar(0x02);
--- trunk/KDE/kdenetwork/kopete/protocols/qq/libeva.h #576026:576027
@@ -393,26 +393,26 @@
// Packet operation
- ByteArray requestLoginToken( int id, short const sequence );
- ByteArray login( int id, short const sequence, const ByteArray& key,
- const ByteArray& token, char const loginMode );
- ByteArray changeStatus( int id, short const sequence, ByteArray& key, char status \
);
- ByteArray userInfo( int id, short const sequence, ByteArray& key, int qqId );
- ByteArray requestTransferKey( int id, short const sequence, const ByteArray& key );
- ByteArray contactList( int id, short const sequence, const ByteArray& key, short \
pos = 0);
- ByteArray getGroupNames( int id, short const sequence, ByteArray& key );
- ByteArray downloadGroups( int id, short const sequence, ByteArray& key, int pos );
- ByteArray textMessage( int id, short const sequence, ByteArray& key, int toId, \
const ByteArray& transferKey, ByteArray& message );
- ByteArray messageReply(int id, short const sequence, ByteArray& key, const \
ByteArray& text );
- ByteArray heartbeat(int id, short const sequence, ByteArray& key );
- ByteArray onlineContacts(int id, short const sequence, const ByteArray& key, uchar \
pos ); + ByteArray requestLoginToken( uint id, ushort sequence );
+ ByteArray login( uint id, ushort sequence, const ByteArray& key,
+ const ByteArray& token, uchar loginMode );
+ ByteArray changeStatus( uint id, ushort sequence, const ByteArray& key, char status \
); + ByteArray userInfo( uint id, ushort sequence, const ByteArray& key, int qqId );
+ ByteArray requestTransferKey( uint id, ushort sequence, const ByteArray& key );
+ ByteArray contactList( uint id, ushort sequence, const ByteArray& key, short pos = \
0); + ByteArray getGroupNames( uint id, ushort sequence, const ByteArray& key );
+ ByteArray downloadGroups( uint id, ushort sequence, const ByteArray& key, int pos \
); + ByteArray textMessage( uint id, ushort sequence, const ByteArray& key, int toId, \
const ByteArray& transferKey, ByteArray& message ); + ByteArray messageReply(uint id, \
ushort sequence, const ByteArray& key, const ByteArray& text ); + ByteArray \
heartbeat(uint id, ushort sequence, const ByteArray& key ); + ByteArray \
onlineContacts(uint id, ushort sequence, const ByteArray& key, uchar pos );
// Misc.
ByteArray loginToken( const ByteArray& buffer );
ByteArray QQHash( const ByteArray& text );
ByteArray decrypt( const ByteArray& code, const ByteArray& key );
const uchar* getInitKey();
- ByteArray buildPacket( int id, short const command, short const sequence, const \
ByteArray& key, const ByteArray& text ); + ByteArray buildPacket( uint id, short \
const command, ushort sequence, const ByteArray& key, const ByteArray& text );
};
--- trunk/KDE/kdenetwork/kopete/protocols/qq/qqnotifysocket.cpp #576026:576027
@@ -377,14 +377,14 @@
sendPacket( QByteArray( data.c_str(), data.size()) );
}
-void QQNotifySocket::sendUserInfo(int qqId)
+void QQNotifySocket::sendUserInfo(Eva::uint qqId)
{
Eva::ByteArray packet = Eva::userInfo( m_qqId, m_id++, m_sessionKey, qqId);
sendPacket( QByteArray( packet.c_str(), packet.size()) );
}
-void QQNotifySocket::sendChangeStatus( char status )
+void QQNotifySocket::sendChangeStatus( uchar status )
{
Eva::ByteArray packet = Eva::changeStatus( m_qqId, m_id++, m_sessionKey, status );
sendPacket( QByteArray( packet.c_str(), packet.size()) );
--- trunk/KDE/kdenetwork/kopete/protocols/qq/qqnotifysocket.h #576026:576027
@@ -86,8 +86,8 @@
void sendLoginTokenRequest();
void sendLogin();
void sendContactList( short pos );
- void sendChangeStatus( char status );
- void sendUserInfo(int qqId);
+ void sendChangeStatus( uchar status );
+ void sendUserInfo(Eva::uint qqId);
void sendRequestTransferKey();
void sendGoodbye() { return; }
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic