Added a first core of the avatars cache. Solved a regression with personal message.

This commit is contained in:
barrett 2011-04-26 21:33:17 +00:00
parent 55d162b108
commit f0c5c07a2e
5 changed files with 186 additions and 137 deletions

View File

@ -31,7 +31,11 @@
#include <netdb.h> #include <netdb.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <Directory.h>
#include <Entry.h> #include <Entry.h>
#include <FindDirectory.h>
#include <Path.h>
#include <SupportDefs.h>
#include <msn.h> #include <msn.h>
@ -41,7 +45,7 @@
extern const char* kProtocolSignature = "msn"; extern const char* kProtocolSignature = "msn";
extern const char* kProtocolName = "MSN Protocol"; extern const char* kProtocolName = "MSN Protocol";
struct pollfd *kPollSockets = NULL; struct pollfd* kPollSockets = NULL;
struct ssl { struct ssl {
bool isSSL; bool isSSL;
bool isConnected; bool isConnected;
@ -52,8 +56,6 @@ struct ssl {
int kSocketsCount = 0; int kSocketsCount = 0;
int kSocketsAvailable = 0; int kSocketsAvailable = 0;
#define AVAT_PATH "/tmp/msnavatarbuddy"
int32 StartPollThread(void* punt) int32 StartPollThread(void* punt)
{ {
MSNP* mainClass = (MSNP*) punt; MSNP* mainClass = (MSNP*) punt;
@ -143,11 +145,13 @@ int32 StartPollThread(void* punt)
MSNP::MSNP() MSNP::MSNP()
: fUsername(""), :
fUsername(""),
fServer("messenger.hotmail.com"), fServer("messenger.hotmail.com"),
fPassword(""), fPassword(""),
fMainConnection(NULL), fMainConnection(NULL),
fSettings(false) fSettings(false),
fCachePath("")
{ {
} }
@ -179,7 +183,18 @@ MSNP::Init(CayaProtocolMessengerInterface* msgr)
fClientID += MSN::SIPInvitations; fClientID += MSN::SIPInvitations;
fClientID += MSN::SupportMultiPacketMessaging; fClientID += MSN::SupportMultiPacketMessaging;
fID = 123456; fID = 963396;
BPath path;
status_t ret = find_directory(B_USER_CONFIG_DIRECTORY, &path);
if (ret != B_OK)
return ret;
BDirectory cacheDir = BDirectory(path.Path());
path.Append("settings/Caya/Cache/msn/");
cacheDir.CreateDirectory(path.Path(), NULL);
fCachePath = path;
return B_OK; return B_OK;
} }
@ -276,18 +291,19 @@ MSNP::Process(BMessage* msg)
break; break;
case CAYA_OFFLINE: case CAYA_OFFLINE:
//if (fLogged) { if (fLogged) {
fMainConnection->disconnect(); fMainConnection->disconnect();
delete fMainConnection; delete fMainConnection;
fMainConnection = NULL;
int end = fBuddyList.CountItems(); int end = fBuddyList.CountItems();
for (int x=0; x != end; x++) { for (int x=0; x != end; x++) {
MSN::Buddy* contact = fBuddyList.ItemAt(x); MSN::Buddy contact = fBuddyList.ItemAt(x);
if (contact->lists & MSN::LST_AL ) { if (contact.lists & MSN::LST_AL ) {
BMessage msg(IM_MESSAGE); BMessage msg(IM_MESSAGE);
msg.AddInt32("im_what", IM_STATUS_SET); msg.AddInt32("im_what", IM_STATUS_SET);
msg.AddString("protocol", kProtocolSignature); msg.AddString("protocol", kProtocolSignature);
msg.AddString("id", contact->userName.c_str()); msg.AddString("id", contact.userName.c_str());
msg.AddInt32("status", CAYA_OFFLINE); msg.AddInt32("status", CAYA_OFFLINE);
fServerMsgr->SendMessage(&msg); fServerMsgr->SendMessage(&msg);
} }
@ -295,7 +311,11 @@ MSNP::Process(BMessage* msg)
fLogged = false; fLogged = false;
fSettings = true; fSettings = true;
suspend_thread(fPollThread); suspend_thread(fPollThread);
//} } else {
delete fMainConnection;
fMainConnection = NULL;
suspend_thread(fPollThread);
}
break; break;
} }
break; break;
@ -454,7 +474,7 @@ void
MSNP::Error(const char* message, const char* who) MSNP::Error(const char* message, const char* who)
{ {
BMessage msg(IM_ERROR); BMessage msg(IM_ERROR);
msg.AddString("protocol", kProtocolName); msg.AddString("protocol", kProtocolSignature);
if (who) if (who)
msg.AddString("id", who); msg.AddString("id", who);
msg.AddString("error", message); msg.AddString("error", message);
@ -468,7 +488,7 @@ MSNP::Progress(const char* id, const char* message, float progress)
{ {
BMessage msg(IM_MESSAGE); BMessage msg(IM_MESSAGE);
msg.AddInt32("im_what", IM_PROGRESS ); msg.AddInt32("im_what", IM_PROGRESS );
msg.AddString("protocol", kProtocolName); msg.AddString("protocol", kProtocolSignature);
msg.AddString("progressID", id); msg.AddString("progressID", id);
msg.AddString("message", message); msg.AddString("message", message);
msg.AddFloat("progress", progress); msg.AddFloat("progress", progress);
@ -484,15 +504,15 @@ MSNP::Version() const
} }
void void
MSNP::SendContactInfo(MSN::Buddy* buddy) MSNP::SendContactInfo(MSN::Buddy buddy)
{ {
int32 what = IM_CONTACT_INFO; int32 what = IM_CONTACT_INFO;
BMessage msg(IM_MESSAGE); BMessage msg(IM_MESSAGE);
msg.AddInt32("im_what", what); msg.AddInt32("im_what", what);
msg.AddString("protocol", kProtocolSignature); msg.AddString("protocol", kProtocolSignature);
msg.AddString("id", buddy->userName.c_str()); msg.AddString("id", buddy.userName.c_str());
msg.AddString("name", buddy->friendlyName.c_str()); msg.AddString("name", buddy.friendlyName.c_str());
msg.AddString("email", buddy->userName.c_str()); msg.AddString("email", buddy.userName.c_str());
// Send contact information // Send contact information
fServerMsgr->SendMessage(&msg); fServerMsgr->SendMessage(&msg);
} }
@ -513,26 +533,32 @@ MSNP::MessageFromBuddy(const char* mess, const char* id)
void void
MSNP::RequestBuddyIcon(string msnobject, MSN::Passport buddy) MSNP::RequestBuddyIcon(string msnobject, MSN::Passport buddy)
{ {
if (fAvatarSwitch != NULL) { printf("requestbuddyicon %s\n", buddy.c_str());
fID = fID++; if (fMainConnection->switchboardWithOnlyUser(buddy) == NULL) {
std::string fileName = AVAT_PATH;
fileName.append(buddy).append(".img");
fAvatarSwitch->requestDisplayPicture(fID++, fileName, msnobject);
} else {
MSNContainer* container = new MSNContainer(buddy); MSNContainer* container = new MSNContainer(buddy);
container->SetObject(msnobject); container->SetObject(msnobject);
if (fMainConnection->switchboardWithOnlyUser(buddy) == NULL) { fMainConnection->requestSwitchboardConnection(container);
fMainConnection->requestSwitchboardConnection(container); } else {
} /*else { RequestBuddyIcon(fMainConnection->switchboardWithOnlyUser(buddy),
//fMainConnection->switchboardWithOnlyUser(buddy); msnobject, buddy.c_str());
}*/
} }
} }
void
MSNP::RequestBuddyIcon(MSN::SwitchboardServerConnection* conn, string msnobject, const char* buddy)
{
printf("requestbuddyicon %s\n", buddy);
fID = fID+1;
string fileName = GetFilename(msnobject);
conn->requestDisplayPicture(fID++, fileName, msnobject);
}
void void
MSNP::SendBuddyIcon(string filename, string passport) MSNP::SendBuddyIcon(string filename, string passport)
{ {
printf("sendbddic %s\n", passport.c_str());
entry_ref ref; entry_ref ref;
if (get_ref_for_path(filename.c_str(), &ref) != B_OK) if (get_ref_for_path(filename.c_str(), &ref) != B_OK)
return; return;
@ -546,32 +572,57 @@ MSNP::SendBuddyIcon(string filename, string passport)
bool bool
MSNP::CheckAvatar(string passport) { MSNP::CheckAvatar(string msnobject, string passport) {
string filename = AVAT_PATH; printf("checkav\n");
filename.append(passport).append(".img"); string filename = GetFilename(msnobject);
BEntry entry = BEntry(filename.c_str(), true); BEntry entry = BEntry(filename.c_str(), true);
if (entry.Exists()) { if (entry.Exists()) {
SendBuddyIcon(filename, passport); if (passport != "")
SendBuddyIcon(filename, passport);
return true; return true;
} }
//file.Close();
return false; return false;
} }
string* string
MSNP::Object(string passport) { MSNP::GetObject(string passport) {
for (int32 i = 0; i < fAvatarDone.CountItems(); i++) { for (int i = 0; i < fAvatarDone.CountItems(); i++) {
if (fAvatarDone.ItemAt(i)->first == passport) if (fAvatarDone.ItemAt(i)->first == passport)
return &fAvatarDone.ItemAt(i)->second; return fAvatarDone.ItemAt(i)->second;
} }
for (int32 i = 0; i < fAvatarQueue.CountItems(); i++) { for (int i = 0; i < fAvatarQueue.CountItems(); i++) {
if (fAvatarQueue.ItemAt(i)->first == passport) if (fAvatarQueue.ItemAt(i)->first == passport)
return &fAvatarQueue.ItemAt(i)->second; return fAvatarQueue.ItemAt(i)->second;
} }
return NULL; printf("null\n");
return "";
} }
string
MSNP::GetFilename(string msnobject) {
const char* str = FindSHA1D(msnobject);
BString filename = fCachePath.Path();
filename << "/" << str;
printf(" filename %s \n", filename.String());
return filename.String();
}
const char*
MSNP::FindSHA1D(string msnobject) {
BString str = BString(msnobject.c_str());
BString ret;
int32 index = str.FindFirst("SHA1D=");
index += 7;
str.CopyInto(ret, index, (int32) 28);
printf(ret.String());
return ret.String();
}
/********************/ /********************/
/* libmsn callbacks */ /* libmsn callbacks */
/********************/ /********************/
@ -714,31 +765,31 @@ void MSNP::gotBuddyListInfo(MSN::NotificationServerConnection* conn, MSN::ListSy
std::map<std::string, int> allContacts; std::map<std::string, int> allContacts;
//Progress("MSN Protocol Login", "MSN Protocol: Logged in!", 0.90); //Progress("MSN Protocol Login", "MSN Protocol: Logged in!", 0.90);
for (; i != info->contactList.end(); i++) { for (; i != info->contactList.end(); i++) {
MSN::Buddy contact = *(*i).second; MSN::Buddy* contact = (*i).second;
if (contact.lists & MSN::LST_AB ) { if (contact->lists & MSN::LST_AB ) {
allContacts[contact.userName.c_str()]=0; allContacts[contact->userName.c_str()]=0;
allContacts[contact.userName.c_str()] |= MSN::LST_AB; allContacts[contact->userName.c_str()] |= MSN::LST_AB;
} }
if (contact.lists & MSN::LST_AL) { if (contact->lists & MSN::LST_AL) {
allContacts[contact.userName.c_str()] |= MSN::LST_AL; allContacts[contact->userName.c_str()] |= MSN::LST_AL;
//printf("-AL %s \n", contact.userName.c_str()); //printf("-AL %s \n", contact.userName.c_str());
fBuddyList.AddItem(&contact); fBuddyList.AddItem(*contact);
} }
if (contact.lists & MSN::LST_BL) { if (contact->lists & MSN::LST_BL) {
allContacts[contact.userName.c_str()] |= MSN::LST_BL; allContacts[contact->userName.c_str()] |= MSN::LST_BL;
} }
if (contact.lists & MSN::LST_RL) { if (contact->lists & MSN::LST_RL) {
//printf("-RL %s \n", contact.userName.c_str()); //printf("-RL %s \n", contact.userName.c_str());
} }
if (contact.lists & MSN::LST_PL) { if (contact->lists & MSN::LST_PL) {
//printf("-PL %s \n", contact.userName.c_str()); //printf("-PL %s \n", contact.userName.c_str());
} }
if (contact.lists & MSN::LST_AL) { if (contact->lists & MSN::LST_AL) {
allContacts[contact.userName.c_str()] |= MSN::LST_AL; allContacts[contact->userName.c_str()] |= MSN::LST_AL;
//printf("-AL %s \n", contact.userName.c_str()); //printf("-AL %s \n", contact.userName.c_str());
fBuddyList.AddItem(&contact); fBuddyList.AddItem(*contact);
} }
} }
conn->completeConnection(allContacts,info); conn->completeConnection(allContacts,info);
@ -791,16 +842,16 @@ void MSNP::connectionReady(MSN::Connection * conn)
int end = fBuddyList.CountItems(); int end = fBuddyList.CountItems();
int x; int x;
for (x=0; x != end; x++) { for (x=0; x != end; x++) {
MSN::Buddy* contact = fBuddyList.ItemAt(x); MSN::Buddy contact = fBuddyList.ItemAt(x);
if (contact->lists & MSN::LST_AL) { if (contact.lists & MSN::LST_AL) {
serverBased.AddString("id", contact->userName.c_str()); serverBased.AddString("id", contact.userName.c_str());
} }
} }
fServerMsgr->SendMessage(&serverBased); fServerMsgr->SendMessage(&serverBased);
for (x=0; x != end; x++) { for (x=0; x != end; x++) {
MSN::Buddy* contact = fBuddyList.ItemAt(x); MSN::Buddy contact = fBuddyList.ItemAt(x);
if (contact->lists & MSN::LST_AL) { if (contact.lists & MSN::LST_AL) {
SendContactInfo(contact); SendContactInfo(contact);
} }
} }
@ -853,12 +904,13 @@ void MSNP::renamedGroup(MSN::NotificationServerConnection * conn, bool renamed,
void MSNP::showError(MSN::Connection * conn, std::string msg) void MSNP::showError(MSN::Connection * conn, std::string msg)
{ {
// printf("MSNP::showError: %s", msg.c_str()); printf("MSNP::showError: %s", msg.c_str());
} }
void MSNP::buddyChangedStatus(MSN::NotificationServerConnection* conn, MSN::Passport buddy, std::string friendlyname, MSN::BuddyStatus status, unsigned int clientID, std::string msnobject) void MSNP::buddyChangedStatus(MSN::NotificationServerConnection* conn, MSN::Passport buddy, std::string friendlyname, MSN::BuddyStatus status, unsigned int clientID, std::string msnobject)
{ {
printf("chngstat\n");
BMessage msg(IM_MESSAGE); BMessage msg(IM_MESSAGE);
msg.AddInt32("im_what", IM_STATUS_SET); msg.AddInt32("im_what", IM_STATUS_SET);
msg.AddString("protocol", kProtocolSignature); msg.AddString("protocol", kProtocolSignature);
@ -892,34 +944,25 @@ void MSNP::buddyChangedStatus(MSN::NotificationServerConnection* conn, MSN::Pass
fServerMsgr->SendMessage(&msg); fServerMsgr->SendMessage(&msg);
// updating the user informations // updating the user informations
/*BMessage mess(IM_MESSAGE); BMessage mess(IM_MESSAGE);
mess.AddInt32("im_what", IM_CONTACT_INFO); mess.AddInt32("im_what", IM_CONTACT_INFO);
mess.AddString("protocol", kProtocolSignature); //mess.AddString("protocol", kProtocolSignature);
msg.AddString("id", buddy.c_str()); msg.AddString("id", buddy.c_str());
msg.AddString("name", friendlyname.c_str()); msg.AddString("name", friendlyname.c_str());
fServerMsgr->SendMessage(&msg);*/
if (!CheckAvatar(buddy)) fServerMsgr->SendMessage(&msg);
if (!CheckAvatar(msnobject, buddy))
fAvatarQueue.AddItem(new pair<string, string>(buddy, msnobject)); fAvatarQueue.AddItem(new pair<string, string>(buddy, msnobject));
else else
fAvatarDone.AddItem(new pair<string, string>(buddy, msnobject)); fAvatarDone.AddItem(new pair<string, string>(buddy, msnobject));
} }
void MSNP::buddyOffline(MSN::NotificationServerConnection * conn, MSN::Passport buddy) void MSNP::buddyOffline(MSN::NotificationServerConnection* conn, MSN::Passport buddy)
{ {
int x; if(conn->switchboardWithOnlyUser(buddy) != NULL) {
int count = 0; delete conn->switchboardWithOnlyUser(buddy);
count = fSwitchboardList.CountItems();
// TODO use ns functions instead
if (count != 0) {
for (x = 0; x < count; x++) {
if (fSwitchboardList.ItemAt(x)->first == buddy) {
delete fSwitchboardList.ItemAt(x)->second;
fSwitchboardList.RemoveItemAt(x);
break;
}
}
} }
BMessage msg(IM_MESSAGE); BMessage msg(IM_MESSAGE);
@ -936,23 +979,9 @@ void MSNP::gotSwitchboard(MSN::SwitchboardServerConnection* conn, const void* ta
if (!tag) if (!tag)
return; return;
printf("gswitch\n");
MSNContainer* cont = (MSNContainer*) tag; MSNContainer* cont = (MSNContainer*) tag;
conn->inviteUser(cont->Buddy());
if (cont->IsMessage()) {
printf("%s\n", cont->Message().c_str());
conn->inviteUser(cont->Buddy());
}
if (cont->HasObject()) {
if (!fAvatarSwitch || !fAvatarSwitch->isConnected()) {
fAvatarSwitch = conn;
fID = fID++;
std::string fileName = AVAT_PATH;
fileName.append(cont->Buddy()).append(".img");
fAvatarSwitch->requestDisplayPicture(fID++, fileName, cont->Object());
} else {
delete conn;
}
}
} }
@ -960,21 +989,22 @@ void MSNP::buddyJoinedConversation(MSN::SwitchboardServerConnection* conn, MSN::
{ {
if (!conn->auth.tag) if (!conn->auth.tag)
return; return;
printf("joiconv\n");
MSNContainer* cont = (MSNContainer*) (conn->auth.tag); MSNContainer* cont = (MSNContainer*) (conn->auth.tag);
if (cont->IsMessage()) { if (cont->IsMessage()) {
conn->sendTypingNotification(); conn->sendTypingNotification();
fSwitchboardList.AddItem(new pair<string,
MSN::SwitchboardServerConnection*>(username, conn));
int trid = conn->sendMessage(cont->Message()); int trid = conn->sendMessage(cont->Message());
string* obj = Object(username); string obj = GetObject(username);
if (obj != NULL) { if (obj != "") {
std::string fileName = AVAT_PATH; printf("req %s\n", obj.c_str());
fileName.append(username).append(".img"); RequestBuddyIcon(conn, obj, username.c_str());
conn->requestDisplayPicture(fID++, fileName, *obj);
} }
} }
if (cont->HasObject() && !cont->IsMessage()) {
RequestBuddyIcon(conn, cont->Object(), cont->Buddy().c_str());
}
delete cont; delete cont;
conn->auth.tag = NULL; conn->auth.tag = NULL;
} }
@ -1098,19 +1128,32 @@ void MSNP::gotNewConnection(MSN::Connection* conn)
void MSNP::buddyChangedPersonalInfo(MSN::NotificationServerConnection* conn, MSN::Passport fromPassport, MSN::personalInfo pInfo) void MSNP::buddyChangedPersonalInfo(MSN::NotificationServerConnection* conn, MSN::Passport fromPassport, MSN::personalInfo pInfo)
{/* {
int32 what = IM_CONTACT_INFO; int32 what = IM_CONTACT_INFO;
BMessage msg(IM_MESSAGE); BMessage msg(IM_MESSAGE);
msg.AddInt32("im_what", what); msg.AddInt32("im_what", what);
msg.AddString("id", fromPassport.c_str()); msg.AddString("id", fromPassport.c_str());
msg.AddString("message", pInfo.PSM.c_str()); msg.AddString("message", pInfo.PSM.c_str());
fServerMsgr->SendMessage(&msg); */ fServerMsgr->SendMessage(&msg);
} }
void MSNP::closingConnection(MSN::Connection* conn) void MSNP::closingConnection(MSN::Connection* conn)
{ {
printf ("MSNP::closingConnection : connection with socket %d\n", (int)conn->sock); printf ("MSNP::closingConnection : connection with socket %d\n", (int)conn->sock);
int x;
int count = 0;
count = fSwitchboardList.CountItems();
// TODO use ns functions instead
/*if (count != 0) {
for (x = 0; x < count; x++) {
if (fSwitchboardList.ItemAt(x)->second->sock == conn->sock) {
//delete fSwitchboardList.ItemAt(x)->second;
fSwitchboardList.RemoveItemAt(x);
break;
}
}
}*/
} }
@ -1194,7 +1237,7 @@ std::string MSNP::getOurIP(void)
void MSNP::log(int i, const char *s) void MSNP::log(int i, const char *s)
{ {
// printf("MSNP::log %s\n", s); printf("MSNP::log %s\n", s);
} }

View File

@ -18,11 +18,11 @@
#ifndef IMKIT_MSNP_H #ifndef IMKIT_MSNP_H
#define IMKIT_MSNP_H #define IMKIT_MSNP_H
//#include <list>
#include <sys/poll.h> #include <sys/poll.h>
#include <Messenger.h> #include <Messenger.h>
#include <OS.h> #include <OS.h>
#include <Path.h>
#include <String.h> #include <String.h>
#include <libsupport/List.h> #include <libsupport/List.h>
@ -34,39 +34,44 @@
using namespace std; using namespace std;
class MSNP : public MSN::Callbacks, public CayaProtocol { class MSNP : public MSN::Callbacks, public CayaProtocol {
public: public:
MSNP(); MSNP();
virtual ~MSNP(); virtual ~MSNP();
virtual status_t Init(CayaProtocolMessengerInterface*); virtual status_t Init(CayaProtocolMessengerInterface*);
virtual status_t Shutdown(); virtual status_t Shutdown();
virtual status_t Process(BMessage *); virtual status_t Process(BMessage *);
virtual const char * Signature() const; virtual const char * Signature() const;
virtual const char * FriendlySignature() const; virtual const char * FriendlySignature() const;
virtual status_t UpdateSettings(BMessage *); virtual status_t UpdateSettings(BMessage *);
virtual uint32 GetEncoding(); virtual uint32 GetEncoding();
virtual CayaProtocolMessengerInterface* MessengerInterface() const { return fServerMsgr; } virtual CayaProtocolMessengerInterface* MessengerInterface() const { return fServerMsgr; }
virtual MSN::NotificationServerConnection* GetConnection() const { return fMainConnection; } virtual MSN::NotificationServerConnection* GetConnection() const { return fMainConnection; }
virtual uint32 Version() const; virtual uint32 Version() const;
void Error(const char* message, const char* who); void Error(const char* message, const char* who);
void Progress(const char* id, const char* message, float progress); void Progress(const char* id, const char* message, float progress);
void SendContactInfo(MSN::Buddy*); void SendContactInfo(MSN::Buddy buddy);
void MessageFromBuddy(const char* mess, const char* id); void MessageFromBuddy(const char* mess, const char* id);
void RequestBuddyIcon(string msnobject, MSN::Passport buddy);
void SendBuddyIcon(string filename, string passport); void RequestBuddyIcon(string msnobject, MSN::Passport buddy);
bool CheckAvatar(string passport); void RequestBuddyIcon(MSN::SwitchboardServerConnection* conn, string msnobject, const char* buddy);
string* Object(string passport); void SendBuddyIcon(string filename, string passport);
bool CheckAvatar(string msnobject, string passport);
string GetObject(string passport);
string GetFilename(string name);
const char* FindSHA1D(string msnobject);
private: private:
BPath fCachePath;
thread_id fPollThread; thread_id fPollThread;
bool fLogged; bool fLogged;
BString fServer; BString fServer;
@ -76,14 +81,14 @@ private:
string fNickname; string fNickname;
bool fSettings; bool fSettings;
unsigned int fID; unsigned int fID;
CayaProtocolMessengerInterface* fServerMsgr; CayaProtocolMessengerInterface* fServerMsgr;
MSN::NotificationServerConnection* fMainConnection; MSN::NotificationServerConnection* fMainConnection;
List<MSN::Buddy*> fBuddyList; List<MSN::Buddy> fBuddyList;
List<pair<string, MSN::SwitchboardServerConnection*>*> fSwitchboardList; List<pair<string, MSN::SwitchboardServerConnection*>*> fSwitchboardList;
MSN::SwitchboardServerConnection* fAvatarSwitch;
List<pair<string, string>*> fAvatarQueue; List<pair<string, string>*> fAvatarQueue;
List<pair<string, string>*> fAvatarDone; List<pair<string, string>*> fAvatarDone;

View File

@ -13,7 +13,6 @@ MSNContainer::MSNContainer(string buddy)
fMSNObject(""), fMSNObject(""),
fIfMsg(false) fIfMsg(false)
{ {
} }
@ -29,6 +28,4 @@ MSNContainer::MSNContainer(string msg, string rcpt)
MSNContainer::~MSNContainer() MSNContainer::~MSNContainer()
{ {
} }

View File

@ -19,7 +19,7 @@ class MSNContainer {
public: public:
MSNContainer(string buddy); MSNContainer(string buddy);
MSNContainer(string msg, string buddy); MSNContainer(string msg, string buddy);
virtual ~MSNContainer(); virtual ~MSNContainer();
// if it is also a message // if it is also a message
bool IsMessage() { return fIfMsg; } bool IsMessage() { return fIfMsg; }
// if it is used for advanced features like avatars // if it is used for advanced features like avatars
@ -36,8 +36,7 @@ private:
string fMessage; string fMessage;
string fMSNObject; string fMSNObject;
bool fIfMsg; bool fIfMsg;
}; };
#endif // MSNCONTAINER_H #endif // MSNCONTAINER_H

View File

@ -1,7 +1,7 @@
resource(1000) message('IMst') { resource(1000) message('IMst') {
"setting" = message { "setting" = message {
"name" = "username", "name" = "username",
"description" = "Username", "description" = "MSN identifier",
int32 "type" = 'CSTR' int32 "type" = 'CSTR'
}, },
"setting" = message { "setting" = message {
@ -10,10 +10,15 @@ resource(1000) message('IMst') {
int32 "type" = 'CSTR', int32 "type" = 'CSTR',
"is_secret" = true "is_secret" = true
}, },
"setting" = message {
"name" = "server",
"description" = "Server",
int32 "type" = 'CSTR'
},
"setting" = message { "setting" = message {
"name" = "resource", "name" = "resource",
"description" = "Resource", "description" = "Resource",
int32 "type" = 'CSTR', int32 "type" = 'CSTR',
"default" = "Caya" "default" = "Caya"
} }
}; };