From 297fd986f8f82d166a8e7e06a114e15170969f31 Mon Sep 17 00:00:00 2001 From: barrett Date: Sat, 9 Oct 2010 03:36:24 +0000 Subject: [PATCH] momoving msn plugin to caya gpl plugins subproject --- libs/libsupport/List.h | 60 ++ protocols/msn/Jamfile | 20 + protocols/msn/MSN.cpp | 1286 +++++++++++++++++++++++++++ protocols/msn/MSN.h | 258 ++++++ protocols/msn/SettingsTemplate.rdef | 19 + protocols/msn/main.cpp | 25 + protocols/msn/msn.rdef | 42 + 7 files changed, 1710 insertions(+) create mode 100644 libs/libsupport/List.h create mode 100644 protocols/msn/Jamfile create mode 100644 protocols/msn/MSN.cpp create mode 100644 protocols/msn/MSN.h create mode 100644 protocols/msn/SettingsTemplate.rdef create mode 100644 protocols/msn/main.cpp create mode 100644 protocols/msn/msn.rdef diff --git a/libs/libsupport/List.h b/libs/libsupport/List.h new file mode 100644 index 0000000..5682db5 --- /dev/null +++ b/libs/libsupport/List.h @@ -0,0 +1,60 @@ +/* + * Copyright 2009-2010, Pier Luigi Fiorini. All rights reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _LIST_H +#define _LIST_H + +#include + +#include + +template +class List { +public: + uint32 CountItems() const; + + void AddItem(T type); + + void RemoveItemAt(uint32 position); + + T ItemAt(uint32 position); + +private: + std::list fList; + typedef typename std::list::iterator fIter; +}; + + +template +uint32 List::CountItems() const +{ + return fList.size(); +} + + +template +void List::AddItem(T type) +{ + fList.push_back(type); +} + + +template +void List::RemoveItemAt(uint32 position) +{ + fIter i = fList.begin(); + std::advance(i, position); + fList.erase(i); +} + + +template +T List::ItemAt(uint32 position) +{ + fIter i = fList.begin(); + std::advance(i, position); + return *i; +} + +#endif // _LIST_H diff --git a/protocols/msn/Jamfile b/protocols/msn/Jamfile new file mode 100644 index 0000000..963e6d1 --- /dev/null +++ b/protocols/msn/Jamfile @@ -0,0 +1,20 @@ +SubDir TOP protocols msn ; + +SubDirSysHdrs [ FDirName $(TOP) ] ; +SubDirSysHdrs [ FDirName $(TOP) libs ] ; +SubDirSysHdrs [ FDirName $(TOP) libs libmsn ] ; +SubDirSysHdrs [ FDirName $(OPENSSL_INCLUDE_DIR) ] ; +SubDirSysHdrs [ FDirName $(CAYA_INCLUDE_DIR) ] ; + +AddOn msn : + main.cpp + MSN.cpp + : be root $(TARGET_LIBSTDC++) ssl crypto network bnetapi libmsn.a + : msn.rdef SettingsTemplate.rdef +; + +Depends msn : libmsn.a ; + +LINKFLAGS on msn += -L$(OPENSSL_LIBRARY_DIR) ; + +InstallBin $(CAYA_DIRECTORY)/protocols : msn ; diff --git a/protocols/msn/MSN.cpp b/protocols/msn/MSN.cpp new file mode 100644 index 0000000..d6d7fb7 --- /dev/null +++ b/protocols/msn/MSN.cpp @@ -0,0 +1,1286 @@ +/* + * Copyright 2010, Dario Casalinuovo. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "MSN.h" + +extern const char* kProtocolSignature = "msn"; +extern const char* kProtocolName = "MSN Protocol"; + +struct pollfd *kPollSockets = NULL; +struct ssl { + bool isSSL; + bool isConnected; + SSL *ssl; + SSL_CTX *ctx; +} *kSocketsSsl = NULL; + +int kSocketsCount = 0; +int kSocketsAvailable = 0; +int32 StartPollThread(void* punt) +{ + MSNP* mainClass = (MSNP*) punt; + + MSN::NotificationServerConnection* mainConnection = mainClass->GetConnection(); + mainConnection->connect("messenger.hotmail.com", 1863); + while (1) { + if (kPollSockets == NULL) + continue; + + poll(kPollSockets, kSocketsCount, -1); + + for (int i = 0; i < kSocketsCount; i++) { + if (kPollSockets[i].fd == -1) { + continue; + } + if (kPollSockets[i].revents & POLLHUP) { + kPollSockets[i].revents = 0; + continue; + } + if (kPollSockets[i].revents & (POLLIN | POLLOUT | POLLPRI)) { + MSN::Connection *c; + + c = mainConnection->connectionWithSocket((void*)kPollSockets[i].fd); + + if (c != NULL) { + // TODO make the ssl code more styled and less bugged + if (kSocketsSsl[i].isSSL && !kSocketsSsl[i].isConnected) { + BIO *bio_socket_new; + SSL_METHOD *meth=NULL; + meth=const_cast(SSLv23_client_method()); + SSL_library_init(); + kSocketsSsl[i].ctx = SSL_CTX_new(meth); + kSocketsSsl[i].ssl = SSL_new(kSocketsSsl[i].ctx); + bio_socket_new = BIO_new_socket(kPollSockets[i].fd, BIO_CLOSE); + if (!kSocketsSsl[i].ssl) + break; + BIO_set_nbio(bio_socket_new, 0); + SSL_set_bio(kSocketsSsl[i].ssl, bio_socket_new, bio_socket_new); + SSL_set_mode(kSocketsSsl[i].ssl, SSL_MODE_AUTO_RETRY); + + // TODO - fix-me - not async and buggy + // and handle errors + /*int ret =*/ SSL_connect(kSocketsSsl[i].ssl); + kSocketsSsl[i].isConnected = true; + } + + if (c->isConnected() == false) + c->socketConnectionCompleted(); + + if (kPollSockets[i].revents & POLLIN) { + if (kSocketsSsl[i].isSSL && kSocketsSsl[i].isConnected) { + if (SSL_want_read(kSocketsSsl[i].ssl)) { + kPollSockets[i].revents = 0; + continue; + } + } + c->dataArrivedOnSocket(); + } + + if (kPollSockets[i].revents & POLLOUT) { + c->socketIsWritable(); + } + } + } + + if (kPollSockets[i].revents & (POLLERR | POLLNVAL)) { + MSN::Connection *c; + + c = mainConnection->connectionWithSocket((void*)kPollSockets[i].fd); + + if (c != NULL) { + delete c; + } + kPollSockets[i].fd = -1; + kPollSockets[i].revents = 0; + continue; + } + } + + if (kPollSockets[0].revents & POLLIN) { + kPollSockets[0].revents = 0; + } + } +} + + +MSNP::MSNP() + : fUsername(""), + fServer("messenger.hotmail.com"), + fPassword(""), + fMainConnection(NULL), + fSettings(false) +{ + +} + + +MSNP::~MSNP() +{ + Shutdown(); +} + + +status_t +MSNP::Init(CayaProtocolMessengerInterface* msgr) +{ + fServerMsgr = msgr; + fLogged = false; + + fClientID = 0; + fClientID += MSN::MSNC7; + fClientID += MSN::MSNC6; + fClientID += MSN::MSNC5; + fClientID += MSN::MSNC4; + fClientID += MSN::MSNC3; + fClientID += MSN::MSNC2; + fClientID += MSN::MSNC1; + fClientID += MSN::SupportWinks; + fClientID += MSN::VoiceClips; + fClientID += MSN::InkGifSupport; + fClientID += MSN::SIPInvitations; + fClientID += MSN::SupportMultiPacketMessaging; + + return B_OK; +} + + +status_t +MSNP::Shutdown() +{ +// LogOut(); + + return B_OK; +} + + +status_t +MSNP::Process(BMessage* msg) +{ +// printf("Process()\n"); + msg->PrintToStream(); + + switch (msg->what) { + case IM_MESSAGE: + { + int32 im_what = 0; + + msg->FindInt32("im_what", &im_what); + + switch (im_what) { + case IM_SET_OWN_NICKNAME: + { + BString nick; + + if (msg->FindString("nick", &nick) == B_OK) { + if (fLogged) { + fMainConnection->setFriendlyName(nick.String(), true); + fNickname = nick.String(); + } else { + fNickname = nick.String(); + } + } + break; + } + case IM_SET_OWN_STATUS: + { + int32 status = msg->FindInt32("status"); + BString status_msg(""); + msg->FindString("message", &status_msg); + + switch (status) { + case CAYA_ONLINE: + if (fLogged) { + fMainConnection->setState(MSN::STATUS_AVAILABLE, fClientID); + } else if (fSettings) { + if (fMainConnection != NULL) { + break; + } + if (fUsername == "") + Error("Empty Username!", NULL); + if (fPassword == "") + Error("Empty Password!",NULL); + Progress("MSN Protocol: Login", "MSNP: Connecting...", 0.0f); + MSN::Passport username; + try { + username = MSN::Passport(fUsername.c_str()); + } catch (MSN::InvalidPassport & e) { + Error("MSN Protocol: Invalid Passport!", "Error!"); + return B_ERROR; + } + MSN::Callbacks* cb = dynamic_cast (this); + fMainConnection = new MSN::NotificationServerConnection(username, + fPassword.String(), *cb); + + resume_thread(fPollThread); + } else { + Error("MSN Protocol: Settings Error", NULL); + } + break; + case CAYA_AWAY: + if (fLogged) { + fMainConnection->setState(MSN::STATUS_AWAY, fClientID); + } else { + Error("MSN Protocol: You are not logged!", NULL); + } + break; + case CAYA_EXTENDED_AWAY: + + break; + case CAYA_DO_NOT_DISTURB: + if (fLogged) { + fMainConnection->setState(MSN::STATUS_IDLE, fClientID); + } else { + Error("MSN Protocol: You are not logged!", NULL); + } + break; + case CAYA_OFFLINE: + if (fLogged) { + fMainConnection->disconnect(); + delete fMainConnection; + int end = fBuddyList.CountItems(); + int x; + for (x=0; x != end; x++) { + MSN::Buddy contact = fBuddyList.ItemAt(x); + if (contact.lists & MSN::LST_AL ) { + BMessage msg(IM_MESSAGE); + msg.AddInt32("im_what", IM_STATUS_SET); + msg.AddString("protocol", kProtocolSignature); + msg.AddString("id", contact.userName.c_str()); + msg.AddInt32("status", CAYA_OFFLINE); + fServerMsgr->SendMessage(&msg); + } + } + fLogged = false; + fSettings = true; + suspend_thread(fPollThread); + } + break; + default: +// Error("Invalid", NULL); +// Log("caya msn plugin : + break; + } + break; + } + case IM_SEND_MESSAGE: + { + const char* buddy = msg->FindString("id"); + const char* sms = msg->FindString("body"); + const string rcpt_ = buddy; + const string msg_ = sms; + int x, y; + bool nouveau = true; + int count = 0; + count = fSwitchboardList.CountItems(); + if (count != 0) { + for (x=0; x < count; x++) { + if (fSwitchboardList.ItemAt(x)->first == rcpt_) { + if (fSwitchboardList.ItemAt(x)->second->isConnected()) { + nouveau = false; + y = x; + } else { + delete fSwitchboardList.ItemAt(x)->second; + fSwitchboardList.RemoveItemAt(x); + } + break; + } + } + } + + if (nouveau) { + const pair *ctx + = new pair(rcpt_, msg_); + // request a new switchboard connection + fMainConnection->requestSwitchboardConnection(ctx); + + } else { + MSN::SwitchboardServerConnection* conn = fSwitchboardList.ItemAt(y)->second; + conn->sendTypingNotification(); + conn->sendMessage(msg_); + + BMessage msg(IM_MESSAGE); + msg.AddInt32("im_what", IM_MESSAGE_SENT); + msg.AddString("protocol", kProtocolSignature); + msg.AddString("id", buddy); + msg.AddString("body", sms); + fServerMsgr->SendMessage(&msg); + } + break; + } + case IM_REGISTER_CONTACTS: + { + + break; + } + case IM_UNREGISTER_CONTACTS: + { + + break; + } + case IM_USER_STARTED_TYPING: + { + const char* id = msg->FindString("id"); + + int x; + int count = 0; + count = fSwitchboardList.CountItems(); + if (count != 0) { + for (x=0; x < count; x++) { + if (fSwitchboardList.ItemAt(x)->first == id) { + fSwitchboardList.ItemAt(x)->second->sendTypingNotification(); + break; + } + } + } + break; + } + case IM_USER_STOPPED_TYPING: + { + + break; + } + case IM_GET_CONTACT_INFO: + + break; + default: + // We don't handle this im_what code + //LOG(kProtocolName, liDebug, "Got unhandled message: %ld", im_what); + //msg->PrintToStream(); + return B_ERROR; + } + break; + } + default: + // We don't handle this what code + return B_ERROR; + } + return B_OK; +} + + +const char* +MSNP::Signature() const +{ + return kProtocolSignature; +} + + +const char* +MSNP::FriendlySignature() const +{ + return kProtocolName; +} + + +status_t +MSNP::UpdateSettings(BMessage* msg) +{ + printf("updatesettings\n"); + const char* usernm = NULL; + const char* password = NULL; +// const char* res = NULL; + + msg->FindString("username", &usernm); + msg->FindString("password", &password); +// msg->FindString("resource", &res); + + if ((usernm == NULL) || (password == NULL)) { + Error("Error: Username or Password Empty",NULL); + return B_ERROR; + } + + fUsername = usernm; + fPassword.SetTo(password); + + fSettings = true; + + fPollThread = spawn_thread(StartPollThread, + "MSNP-PollThread", B_NORMAL_PRIORITY, this); + + return B_OK; +} + + +uint32 +MSNP::GetEncoding() +{ +return 0xffff; +} + +// other stuff + +void +MSNP::Error(const char* message, const char* who) +{ + BMessage msg(IM_ERROR); + msg.AddString("protocol", kProtocolName); + if (who) + msg.AddString("id", who); + msg.AddString("error", message); + + fServerMsgr->SendMessage( &msg ); +} + + +void +MSNP::Progress(const char* id, const char* message, float progress) +{ + BMessage msg(IM_MESSAGE); + msg.AddInt32("im_what", IM_PROGRESS ); + msg.AddString("protocol", kProtocolName); + msg.AddString("progressID", id); + msg.AddString("message", message); + msg.AddFloat("progress", progress); + msg.AddInt32("state", 11); //IM_impsConnecting ); + + fServerMsgr->SendMessage(&msg); +} + +uint32 +MSNP::Version() const +{ + return CAYA_VERSION_1_PRE_ALPHA_1; +} + +void +MSNP::SendContactInfo(MSN::Buddy* buddy) +{ + int32 what = IM_CONTACT_INFO; + BMessage msg(IM_MESSAGE); + msg.AddInt32("im_what", what); + msg.AddString("protocol", kProtocolSignature); + msg.AddString("id", buddy->userName.c_str()); + msg.AddString("name", buddy->friendlyName.c_str()); + msg.AddString("email", buddy->userName.c_str()); + // Send contact information + fServerMsgr->SendMessage(&msg); +} + + +void +MSNP::MessageFromBuddy(const char* mess, const char* id) +{ + BMessage msg(IM_MESSAGE); + msg.AddInt32("im_what", IM_MESSAGE_RECEIVED); + msg.AddString("protocol", kProtocolSignature); + msg.AddString("id", id); + msg.AddString("body", mess); + fServerMsgr->SendMessage(&msg); +} + + +/********************/ +/* libmsn callbacks */ +/********************/ + +void MSNP::registerSocket(void *s, int reading, int writing, bool isSSL) +{ +// printf("MSNP::registerSocket %d %d %d\n", reading, writing, isSSL); + int x = 0; + if (kSocketsCount == kSocketsAvailable) { + + kPollSockets = (struct pollfd*) realloc(kPollSockets, (kSocketsAvailable + 10) * sizeof(struct pollfd)); + if (kPollSockets == NULL) { + Error("Memory Error!!\n", NULL); + return; + } + + kSocketsSsl = (struct ssl*) realloc(kSocketsSsl, (kSocketsAvailable + 10) * sizeof(struct ssl)); + if (kSocketsSsl == NULL) { + Error("Memory Error!!\n", NULL); + return; + } + x=kSocketsCount; + kSocketsAvailable += 10; + for (x; x < kSocketsAvailable; x++) { + kPollSockets[x].fd = -1; + kPollSockets[x].events = 0; + kPollSockets[x].revents = 0; + kSocketsSsl[x].isSSL = false; + kSocketsSsl[x].isConnected = false; + kSocketsSsl[x].ctx = NULL; + kSocketsSsl[x].ssl = NULL; + } + x=kSocketsCount; + kPollSockets[x].fd = getSocketFileDescriptor(s); + kPollSockets[x].revents = 0; + kPollSockets[x].events = 0; + + if (reading) + kPollSockets[x].events |= POLLIN; + if (writing) + kPollSockets[x].events |= POLLOUT; + if (isSSL) + kSocketsSsl[x].isSSL = true; + + kSocketsCount++; + return; + } + + if (kPollSockets != NULL) { + for (x = 0; x < kSocketsCount+kSocketsAvailable; x++) { + if (getSocketFileDescriptor(s) == kPollSockets[x].fd || kPollSockets[x].fd == -1) { + if(kPollSockets[x].fd == -1) + kSocketsCount++; + + kPollSockets[x].fd = getSocketFileDescriptor(s); + + kPollSockets[x].events = 0; + + if (reading) + kPollSockets[x].events |= POLLIN; + if (writing) + kPollSockets[x].events |= POLLOUT; + if (isSSL) + kSocketsSsl[x].isSSL = true; + return; + } + } + } +} + + +int +MSNP::getSocketFileDescriptor (void *sock) +{ + long a = (long)sock; + return (int)a; +} + + +void MSNP::closeSocket(void *s) +{ +//printf("MSNP::closeSocket\n"); + int x; + for (x = 0; x < kSocketsCount; x++) { + if (getSocketFileDescriptor(s) == kPollSockets[x].fd) { + close(getSocketFileDescriptor(s)); + if (kSocketsSsl[x].isSSL) { + if (kSocketsSsl[x].ssl) { + SSL_set_shutdown(kSocketsSsl[x].ssl, + SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN); + SSL_free(kSocketsSsl[x].ssl); + + if (kSocketsSsl[x].ctx) + SSL_CTX_free(kSocketsSsl[x].ctx); + } + } + int i = x; + for (i; i < kSocketsCount; i++) { + kPollSockets[i] = kPollSockets[i+1]; + kSocketsSsl[i] = kSocketsSsl[i+1]; + } + i = kSocketsCount; + kPollSockets[i].fd = -1; + kPollSockets[i].revents = 0; + kPollSockets[i].events = 0; + kSocketsSsl[i].isConnected = false; + kSocketsSsl[i].isSSL = false; + kSocketsSsl[i].ctx = NULL; + kSocketsSsl[i].ssl = NULL; + } + } + kSocketsCount--; +} + + +void MSNP::unregisterSocket(void *s) +{ +// printf("MSNP::unregisterSocket"); + for (int x = 0; x < kSocketsCount; x++) { + if (kPollSockets[x].fd == getSocketFileDescriptor(s)) + kPollSockets[x].events = 0; + } +} + + +void MSNP::gotFriendlyName(MSN::NotificationServerConnection * conn, std::string friendlyname) +{ + BMessage msg(IM_MESSAGE); + msg.AddInt32("im_what", IM_OWN_CONTACT_INFO); + msg.AddString("protocol", kProtocolSignature); + msg.AddString("id", fUsername.c_str()); + msg.AddString("name", friendlyname.c_str()); + fServerMsgr->SendMessage(&msg); + +} + + +void MSNP::gotBuddyListInfo(MSN::NotificationServerConnection* conn, MSN::ListSyncInfo* info) +{ + std::map::iterator i = info->contactList.begin(); + std::map allContacts; + //Progress("MSN Protocol Login", "MSN Protocol: Logged in!", 0.90); + for (; i != info->contactList.end(); i++) { + MSN::Buddy *contact = (*i).second; + if (contact->lists & MSN::LST_AB ) { + allContacts[contact->userName.c_str()]=0; + allContacts[contact->userName.c_str()] |= MSN::LST_AB; + } + if (contact->lists & MSN::LST_AL) { + allContacts[contact->userName.c_str()] |= MSN::LST_AL; + printf("-AL %s \n", contact->userName.c_str()); + fBuddyList.AddItem(*contact); + } + + if (contact->lists & MSN::LST_BL) { + allContacts[contact->userName.c_str()] |= MSN::LST_BL; + } + + if (contact->lists & MSN::LST_RL) { + printf("-RL %s \n", contact->userName.c_str()); + } + if (contact->lists & MSN::LST_PL) { + printf("-PL %s \n", contact->userName.c_str()); + } + } + conn->completeConnection(allContacts,info); +} + + +void MSNP::gotLatestListSerial(MSN::NotificationServerConnection * conn, std::string lastChange) +{ + +} + + +void MSNP::gotGTC(MSN::NotificationServerConnection * conn, char c) +{ + +} + + +void MSNP::gotOIMDeleteConfirmation(MSN::NotificationServerConnection * conn, bool success, std::string id) +{ + +} + + +void MSNP::gotOIMSendConfirmation(MSN::NotificationServerConnection * conn, bool success, int id) +{ + +} + + +void MSNP::gotOIM(MSN::NotificationServerConnection * conn, bool success, std::string id, std::string message) +{ + +} + + +void MSNP::gotOIMList(MSN::NotificationServerConnection * conn, std::vector OIMs) +{ + +} + + +void MSNP::connectionReady(MSN::Connection * conn) +{ + fLogged = true; + BMessage serverBased(IM_MESSAGE); + serverBased.AddInt32("im_what", IM_CONTACT_LIST); + serverBased.AddString("protocol", kProtocolSignature); + + int end = fBuddyList.CountItems(); + int x; + for (x=0; x != end; x++) { + MSN::Buddy contact = fBuddyList.ItemAt(x); + if (contact.lists & MSN::LST_AL ) { + serverBased.AddString("id", contact.userName.c_str()); + } + } + fServerMsgr->SendMessage(&serverBased); + + for (x=0; x != end; x++) { + MSN::Buddy contact = fBuddyList.ItemAt(x); + if (contact.lists & MSN::LST_AL ) { + SendContactInfo(&contact); + } + } + + BMessage msg(IM_MESSAGE); + msg.AddInt32("im_what", IM_OWN_STATUS_SET); + msg.AddString("protocol", kProtocolSignature); + msg.AddInt32("status", CAYA_ONLINE); + fServerMsgr->SendMessage(&msg); + Progress("MSN Protocol Login", "MSN Protocol: Logged in!", 1.00); + fMainConnection->setState(MSN::STATUS_AVAILABLE, fClientID); +} + + +void MSNP::gotBLP(MSN::NotificationServerConnection * conn, char c) +{ + +} + + +void MSNP::addedListEntry(MSN::NotificationServerConnection * conn, MSN::ContactList list, MSN::Passport username, std::string friendlyname) +{ + +} + + +void MSNP::removedListEntry(MSN::NotificationServerConnection * conn, MSN::ContactList list, MSN::Passport username) +{ + +} + + +void MSNP::addedGroup(MSN::NotificationServerConnection * conn, bool added, std::string groupName, std::string groupID) +{ + +} + + +void MSNP::removedGroup(MSN::NotificationServerConnection * conn, bool removed, std::string groupID) +{ + +} + + +void MSNP::renamedGroup(MSN::NotificationServerConnection * conn, bool renamed, std::string newGroupName, std::string groupID) +{ + +} + + +void MSNP::showError(MSN::Connection * conn, std::string msg) +{ +// 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) +{ + BMessage msg(IM_MESSAGE); + msg.AddInt32("im_what", IM_STATUS_SET); + msg.AddString("protocol", kProtocolSignature); + msg.AddString("id", buddy.c_str()); + switch(status) { + case MSN::STATUS_AVAILABLE : + msg.AddInt32("status", CAYA_ONLINE); + break; + case MSN::STATUS_AWAY : + msg.AddInt32("status", CAYA_AWAY); + break; + case MSN::STATUS_IDLE : + msg.AddInt32("status", CAYA_DO_NOT_DISTURB); + break; + case MSN::STATUS_BUSY : + msg.AddInt32("status", CAYA_DO_NOT_DISTURB); + break; + case MSN::STATUS_BERIGHTBACK : + msg.AddInt32("status", CAYA_AWAY); + break; + case MSN::STATUS_ONTHEPHONE : + msg.AddInt32("status", CAYA_DO_NOT_DISTURB); + break; + case MSN::STATUS_OUTTOLUNCH : + msg.AddInt32("status", CAYA_AWAY); + break; + default : + msg.AddInt32("status", CAYA_OFFLINE); + break; + } + fServerMsgr->SendMessage(&msg); + + // updating the user informations + BMessage mess(IM_MESSAGE); + mess.AddInt32("im_what", IM_CONTACT_INFO); + mess.AddString("protocol", kProtocolSignature); + msg.AddString("id", buddy.c_str()); + msg.AddString("name", friendlyname.c_str()); + fServerMsgr->SendMessage(&msg); +} + + +void MSNP::buddyOffline(MSN::NotificationServerConnection * conn, MSN::Passport buddy) +{ + int x; + int count = 0; + count = fSwitchboardList.CountItems(); + 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); + msg.AddInt32("im_what", IM_STATUS_SET); + msg.AddString("protocol", kProtocolSignature); + msg.AddString("id", buddy.c_str()); + msg.AddInt32("status", CAYA_OFFLINE); + fServerMsgr->SendMessage(&msg); +} + + +void MSNP::gotSwitchboard(MSN::SwitchboardServerConnection * conn, const void * tag) +{ + if (tag) { + const pair *ctx = static_cast *>(tag); + conn->inviteUser(ctx->first); + } +} + + +void MSNP::buddyJoinedConversation(MSN::SwitchboardServerConnection * conn, MSN::Passport username, std::string friendlyname, int is_initial) +{ + if (conn->auth.tag) { + const pair *ctx = static_cast *>(conn->auth.tag); + conn->sendTypingNotification(); + /*int trid = */conn->sendMessage(ctx->second); + fSwitchboardList.AddItem(new pair(username, conn)); + delete ctx; + conn->auth.tag = NULL; + std::string message = "** Buddy "; + message.append(username); + message.append(" joined conversation"); + MessageFromBuddy(message.c_str(), username.c_str()); + } +} + + +void MSNP::buddyLeftConversation(MSN::SwitchboardServerConnection * conn, MSN::Passport username) +{ +// printf("MSNP::buddyLeftConversation\n"); + int x; + int count = 0; + count = fSwitchboardList.CountItems(); + if (count != 0) { + for (x=0; x < count; x++) { + if (fSwitchboardList.ItemAt(x)->second == conn) { + //delete fSwitchboardList.ItemAt(x)->second; + //fSwitchboardList.RemoveItemAt(x); + MessageFromBuddy("** Buddy left conversation", username.c_str()); + break; + } + } + } +} + + +void MSNP::gotInstantMessage(MSN::SwitchboardServerConnection * conn, MSN::Passport username, std::string friendlyname, MSN::Message * msg) +{ + MessageFromBuddy(msg->getBody().c_str(), username.c_str()); +} + + +void MSNP::gotEmoticonNotification(MSN::SwitchboardServerConnection * conn, MSN::Passport username, std::string alias, std::string msnobject) +{ +// printf("MSNP::gotEmoticonNotification\n"); +} + + +void MSNP::failedSendingMessage(MSN::Connection * conn) +{ +//TODO implement it +} + + +void MSNP::buddyTyping(MSN::SwitchboardServerConnection * conn, MSN::Passport username, std::string friendlyname) +{ + BMessage msg(IM_MESSAGE); + msg.AddInt32("im_what", IM_CONTACT_STARTED_TYPING); + msg.AddString("protocol", kProtocolSignature); + msg.AddString("id", username.c_str()); + fServerMsgr->SendMessage(&msg); +} + + +void MSNP::gotNudge(MSN::SwitchboardServerConnection * conn, MSN::Passport username) +{ + MessageFromBuddy("** Nudge!!!", username.c_str()); +} + + +void MSNP::gotVoiceClipNotification(MSN::SwitchboardServerConnection * conn, MSN::Passport username, std::string msnobject) +{ + MessageFromBuddy("** Sent you a Voice Clip, but Caya cannot yet display it", username.c_str()); +} + + +void MSNP::gotWinkNotification(MSN::SwitchboardServerConnection * conn, MSN::Passport username, std::string msnobject) +{ + MessageFromBuddy("** Sent you a Wink, but Caya cannot yet display it", username.c_str()); +} + + +void MSNP::gotInk(MSN::SwitchboardServerConnection * conn, MSN::Passport username, std::string image) +{ + MessageFromBuddy("** Sent you an Ink draw, but Caya cannot yet display it", username.c_str()); +} + + +void MSNP::gotContactDisplayPicture(MSN::SwitchboardServerConnection * conn, MSN::Passport passport, std::string filename ) +{ + printf("MSNP::gotContactDisplayPicture %s\n", filename.c_str()); +} + + +void MSNP::gotActionMessage(MSN::SwitchboardServerConnection * conn, MSN::Passport username, std::string message) +{ +// printf("MSNP::gotActionMessage\n"); +} + + +void MSNP::gotInitialEmailNotification(MSN::NotificationServerConnection * conn, int msgs_inbox, int unread_inbox, int msgs_folders, int unread_folders) +{ + +} + + +void MSNP::gotNewEmailNotification(MSN::NotificationServerConnection * conn, std::string from, std::string subject) +{ + +} + + +void MSNP::fileTransferInviteResponse(MSN::SwitchboardServerConnection * conn, unsigned int sessionID, bool response) +{ + +} + + +void MSNP::fileTransferProgress(MSN::SwitchboardServerConnection * conn, unsigned int sessionID, unsigned long long transferred, unsigned long long total) +{ + +} + + +void MSNP::fileTransferFailed(MSN::SwitchboardServerConnection * conn, unsigned int sessionID, MSN::fileTransferError error) +{ + +} + + +void MSNP::fileTransferSucceeded(MSN::SwitchboardServerConnection * conn, unsigned int sessionID) +{ + +} + + +void MSNP::gotNewConnection(MSN::Connection * conn) +{ + // this is at least what the method should do. + if (dynamic_cast(conn)) + dynamic_cast(conn)->synchronizeContactList(); + // we call synchronizeContactList and the callback GotBuddyListInfo is called + // from libmsn if all goes well +} + + +void MSNP::buddyChangedPersonalInfo(MSN::NotificationServerConnection * conn, MSN::Passport fromPassport, MSN::personalInfo pInfo) +{ +} + + +void MSNP::closingConnection(MSN::Connection * conn) +{ +// printf ("MSNP::closingConnection : connection with socket %d\n", (int)conn->sock); +} + + +void MSNP::changedStatus(MSN::NotificationServerConnection * conn, MSN::BuddyStatus state) +{ + MSN::personalInfo pInfo; +// pInfo.PSM="From Caya at Haiku OS - www.haiku-os.org"; + conn->setPersonalStatus(pInfo); +} + + +void * MSNP::connectToServer(std::string hostname, int port, bool *connected, bool isSSL) +{ +// printf("MSNP::connectToServer\n"); + struct sockaddr_in sa; + struct hostent *hp; + int s; + + if ((hp = gethostbyname(hostname.c_str())) == NULL) { + errno = ECONNREFUSED; + return (void*)-1; + } + + memset(&sa,0,sizeof(sa)); + memcpy((char *)&sa.sin_addr,hp->h_addr,hp->h_length); /* set address */ + sa.sin_family = hp->h_addrtype; + sa.sin_port = htons((u_short)port); + + if ((s = socket(hp->h_addrtype,SOCK_STREAM,0)) < 0) /* get socket */ + return (void*)-1; + + int oldfdArgs = fcntl(s, F_GETFL, 0); + fcntl(s, F_SETFL, oldfdArgs | O_NONBLOCK); + + if (connect(s,(struct sockaddr *)&sa,sizeof sa) < 0) { + if (errno != EINPROGRESS) { + close(s); + return (void*)-1; + } + *connected = false; + } else { + *connected = true; + } + return (void*)s; +} + + +int MSNP::listenOnPort(int port) +{ +// printf("MSNP::listenOnPort\n"); + int s; + struct sockaddr_in addr; + + if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { + return -1; + } + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(port); + + if (bind(s, (sockaddr *)(&addr), sizeof(addr)) < 0 || listen(s, 1) < 0) { + close(s); + return -1; + } + return s; +} + + +std::string MSNP::getOurIP(void) +{ + struct hostent* hn; + char buf2[1024]; + + gethostname(buf2, 1024); + hn = gethostbyname(buf2); + + return inet_ntoa( *((struct in_addr*)hn->h_addr)); +} + + +void MSNP::log(int i, const char *s) +{ +// printf("MSNP::log %s\n", s); +} + + +std::string MSNP::getSecureHTTPProxy() +{ + return ""; +} + + +void MSNP::gotMessageSentACK(MSN::SwitchboardServerConnection * conn, int trID) +{ +} + + +void MSNP::askFileTransfer(MSN::SwitchboardServerConnection * conn, MSN::fileTransferInvite ft) +{ + +} + + +void MSNP::addedContactToGroup(MSN::NotificationServerConnection * conn, bool added, std::string groupId, std::string contactId) +{ + +} + + +void MSNP::removedContactFromGroup(MSN::NotificationServerConnection * conn, bool removed, std::string groupId, std::string contactId) +{ + +} + + +void MSNP::addedContactToAddressBook(MSN::NotificationServerConnection * conn, bool added, std::string passport, std::string displayName, std::string guid) +{ + +} + + +void MSNP::removedContactFromAddressBook(MSN::NotificationServerConnection * conn, bool removed, std::string contactId, std::string passport) +{ + +} + + +void MSNP::enabledContactOnAddressBook(MSN::NotificationServerConnection * conn, bool enabled, std::string contactId, std::string passport) +{ + +} + + +void MSNP::disabledContactOnAddressBook(MSN::NotificationServerConnection * conn, bool disabled, std::string contactId) +{ + +} + + +size_t MSNP::getDataFromSocket (void* sock, char* data, size_t size) +{ +// printf("MSNP::getDataFromSocket\n"); + int idx=0; + bool ssl_done = false; + int newAmountRead = 0; + for (int i = 0; i < kSocketsCount; i++) { + if (kPollSockets[i].fd == getSocketFileDescriptor(sock)) { + idx = i; + break; + } + } + + if (!kSocketsSsl[idx].isSSL) { + int newWritten = ::recv(getSocketFileDescriptor(sock), data, size, 0); + if (errno == EAGAIN) + return -1; + return newWritten; + } + + if (!kSocketsSsl[idx].isConnected) + return 0; + + while (!ssl_done) { + if (!kSocketsSsl[idx].ssl) break; + newAmountRead = SSL_read(kSocketsSsl[idx].ssl, data, size); + switch(SSL_get_error(kSocketsSsl[idx].ssl, newAmountRead)) + { + case SSL_ERROR_NONE: + return newAmountRead; + case SSL_ERROR_ZERO_RETURN: + return 0; + case SSL_ERROR_WANT_READ: + case SSL_ERROR_WANT_WRITE: + ssl_done=false; + break; + case SSL_ERROR_SSL: + return 0; + break; + case SSL_ERROR_SYSCALL: + return 0; + break; + default: + return newAmountRead; + } + } + return 0; +} + + +size_t MSNP::writeDataToSocket (void* sock, char* data, size_t size) +{ +// printf("MSNP::writeDataToSocket\n"); + size_t written = 0; + int idx; + for (int i = 0; i < kSocketsCount; i++) { + if (kPollSockets[i].fd == getSocketFileDescriptor(sock)) { + idx = i; + break; + } + } + + while (written < size) { + int newWritten; + if (kSocketsSsl[idx].isSSL) { + if (!kSocketsSsl[idx].isConnected) + return 0; + newWritten = SSL_write(kSocketsSsl[idx].ssl, data, (int) (size - written)); + int error = SSL_get_error(kSocketsSsl[idx].ssl,newWritten); + switch (error) { + case SSL_ERROR_NONE: + written += newWritten; + data+=newWritten; + break; + case SSL_ERROR_WANT_WRITE: + case SSL_ERROR_WANT_READ: + continue; + case SSL_ERROR_ZERO_RETURN: + break; + case SSL_ERROR_SYSCALL: + default: + break; + } + } else { + newWritten = ::send(getSocketFileDescriptor(sock), data, (int)(size - written), 0); + + if (newWritten <= 0) { + if (errno == EAGAIN) { + continue; + } else { + break; + } + } + written += newWritten; + data+=newWritten; + } + } + if (written != size) { + showError(NULL, "Error on socket"); + unregisterSocket(sock); + closeSocket(sock); + return written; + } + return written; +} + + +void MSNP::gotVoiceClipFile(MSN::SwitchboardServerConnection* conn, unsigned int sessionID, std::string file) +{ + +} + + +void MSNP::gotEmoticonFile(MSN::SwitchboardServerConnection* conn, unsigned int sessionID, std::string alias, std::string file) +{ + +} + + +void MSNP::gotWinkFile(MSN::SwitchboardServerConnection* conn, unsigned int sessionID, std::string file) +{ + +} + + +void MSNP::gotInboxUrl(MSN::NotificationServerConnection* conn, MSN::hotmailInfo info) +{ + +} diff --git a/protocols/msn/MSN.h b/protocols/msn/MSN.h new file mode 100644 index 0000000..81c7adf --- /dev/null +++ b/protocols/msn/MSN.h @@ -0,0 +1,258 @@ +/* + * Copyright 2010, Dario Casalinuovo. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef IMKIT_MSNP_H +#define IMKIT_MSNP_H + +//#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include + +using namespace std; + +class MSNP : public MSN::Callbacks, public CayaProtocol { +public: + + MSNP(); + virtual ~MSNP(); + + virtual status_t Init(CayaProtocolMessengerInterface*); + + virtual status_t Shutdown(); + + virtual status_t Process(BMessage *); + + virtual const char * Signature() const; + virtual const char * FriendlySignature() const; + + virtual status_t UpdateSettings(BMessage *); + + virtual uint32 GetEncoding(); + + virtual CayaProtocolMessengerInterface* MessengerInterface() const { return fServerMsgr; } + virtual MSN::NotificationServerConnection* GetConnection() const { return fMainConnection; } + virtual uint32 Version() const; + + void Error(const char* message, const char* who); + void Progress(const char* id, const char* message, float progress); + void SendContactInfo(MSN::Buddy*); + void MessageFromBuddy(const char* mess, const char* id); + +; +private: + + thread_id fPollThread; + bool fLogged; + BString fServer; + string fUsername; + BString fPassword; + uint fClientID; + string fNickname; + + bool fSettings; + + CayaProtocolMessengerInterface* fServerMsgr; + List fBuddyList; + List*> fSwitchboardList; + MSN::NotificationServerConnection* fMainConnection; +// LibMSN Callbacks : + virtual void registerSocket(void* s, int read, int write, bool isSSL); + + virtual void unregisterSocket(void* s); + + virtual void closeSocket(void* s); + + virtual void showError(MSN::Connection* conn, std::string msg); + + virtual void buddyChangedStatus(MSN::NotificationServerConnection* conn, + MSN::Passport buddy, std::string friendlyname, MSN::BuddyStatus state, + unsigned int clientID, std::string msnobject); + + virtual void buddyOffline(MSN::NotificationServerConnection* conn, + MSN::Passport buddy); + + virtual void log(int writing, const char* buf); + + virtual void buddyChangedPersonalInfo(MSN::NotificationServerConnection* conn, + MSN::Passport fromPassport, MSN::personalInfo); + + virtual void gotFriendlyName(MSN::NotificationServerConnection* conn, + std::string friendlyname); + + virtual void gotBuddyListInfo(MSN::NotificationServerConnection* conn, + MSN::ListSyncInfo* data); + + virtual void gotLatestListSerial(MSN::NotificationServerConnection* conn, + std::string lastChange); + + virtual void gotGTC(MSN::NotificationServerConnection* conn, char c); + + virtual void gotBLP(MSN::NotificationServerConnection* conn, char c); + + virtual void addedListEntry(MSN::NotificationServerConnection* conn, + MSN::ContactList list, MSN::Passport buddy, std::string friendlyname); + + virtual void removedListEntry(MSN::NotificationServerConnection* conn, + MSN::ContactList list, MSN::Passport buddy); + + virtual void addedGroup(MSN::NotificationServerConnection* conn, + bool added, std::string groupName, std::string groupID); + + virtual void removedGroup(MSN::NotificationServerConnection* conn, + bool removed, std::string groupID); + + virtual void renamedGroup(MSN::NotificationServerConnection* conn, + bool renamed, std::string newGroupName, std::string groupID); + + virtual void addedContactToGroup(MSN::NotificationServerConnection* conn, + bool added, std::string groupId, std::string contactId); + + virtual void removedContactFromGroup(MSN::NotificationServerConnection* conn, + bool removed, std::string groupId, std::string contactId); + + virtual void addedContactToAddressBook(MSN::NotificationServerConnection* conn, + bool added, std::string passport, std::string displayName, std::string guid); + + virtual void removedContactFromAddressBook(MSN::NotificationServerConnection* conn, + bool removed, std::string contactId, std::string passport); + + virtual void enabledContactOnAddressBook(MSN::NotificationServerConnection* conn, + bool enabled, std::string contactId, std::string passport); + virtual void disabledContactOnAddressBook(MSN::NotificationServerConnection* conn, + bool disabled, std::string contactId); + + virtual void gotSwitchboard(MSN::SwitchboardServerConnection* conn, const void* tag); + + virtual void buddyJoinedConversation(MSN::SwitchboardServerConnection* conn, + MSN::Passport buddy, std::string friendlyname, int is_initial); + + virtual void buddyLeftConversation(MSN::SwitchboardServerConnection* conn, + MSN::Passport buddy); + + virtual void gotInstantMessage(MSN::SwitchboardServerConnection * conn, + MSN::Passport buddy, std::string friendlyname, MSN::Message* msg); + + virtual void gotMessageSentACK(MSN::SwitchboardServerConnection * conn, int trID); + + virtual void gotEmoticonNotification(MSN::SwitchboardServerConnection* conn, + MSN::Passport buddy, std::string alias, std::string msnobject); + + virtual void failedSendingMessage(MSN::Connection * conn); + + virtual void buddyTyping(MSN::SwitchboardServerConnection* conn, + MSN::Passport buddy, std::string friendlyname); + + virtual void gotNudge(MSN::SwitchboardServerConnection* conn, MSN::Passport from); + + virtual void gotVoiceClipNotification(MSN::SwitchboardServerConnection* conn, + MSN::Passport from, std::string msnobject); + + virtual void gotWinkNotification(MSN::SwitchboardServerConnection* conn, + MSN::Passport from, std::string msnobject); + + virtual void gotInk(MSN::SwitchboardServerConnection* conn, + MSN::Passport from, std::string image); + + virtual void gotVoiceClipFile(MSN::SwitchboardServerConnection* conn, + unsigned int sessionID, std::string file); + + virtual void gotEmoticonFile(MSN::SwitchboardServerConnection* conn, + unsigned int sessionID, std::string alias, std::string file); + + virtual void gotWinkFile(MSN::SwitchboardServerConnection* conn, + unsigned int sessionID, std::string file); + + virtual void gotActionMessage(MSN::SwitchboardServerConnection* conn, + MSN::Passport username, std::string message); + + virtual void gotInitialEmailNotification(MSN::NotificationServerConnection* conn, + int msgs_inbox, int unread_inbox, int msgs_folders, int unread_folders); + + virtual void gotNewEmailNotification(MSN::NotificationServerConnection* conn, + std::string from, std::string subject); + + virtual void fileTransferProgress(MSN::SwitchboardServerConnection* conn, + unsigned int sessionID, long long unsigned transferred, long long unsigned total); + + virtual void fileTransferFailed(MSN::SwitchboardServerConnection* conn, + unsigned int sessionID, MSN::fileTransferError error); + + virtual void fileTransferSucceeded(MSN::SwitchboardServerConnection* conn, + unsigned int sessionID); + + virtual void fileTransferInviteResponse(MSN::SwitchboardServerConnection* conn, + unsigned int sessionID, bool response); + + virtual void gotNewConnection(MSN::Connection* conn); + + virtual void gotOIMList(MSN::NotificationServerConnection* conn, + std::vector OIMs); + + virtual void gotOIM(MSN::NotificationServerConnection* conn, + bool success, std::string id, std::string message); + + virtual void gotOIMSendConfirmation(MSN::NotificationServerConnection* conn, + bool success, int id); + + virtual void gotOIMDeleteConfirmation(MSN::NotificationServerConnection* conn, + bool success, std::string id); + + virtual void gotContactDisplayPicture(MSN::SwitchboardServerConnection* conn, + MSN::Passport passport, std::string filename); + + virtual void closingConnection(MSN::Connection* conn); + + virtual void changedStatus(MSN::NotificationServerConnection* conn, + MSN::BuddyStatus state); + + virtual void* connectToServer(std::string server, int port, + bool* connected, bool isSSL); + + virtual void connectionReady(MSN::Connection* conn); + + virtual void askFileTransfer(MSN::SwitchboardServerConnection*conn, + MSN::fileTransferInvite ft); + + virtual int listenOnPort(int port); + + virtual std::string getOurIP(); + + virtual int getSocketFileDescriptor (void* sock); + + virtual size_t getDataFromSocket (void* sock, char* data, size_t size); + + virtual size_t writeDataToSocket (void* sock, char* data, size_t size); + + virtual std::string getSecureHTTPProxy(); + virtual void gotInboxUrl (MSN::NotificationServerConnection *conn, + MSN::hotmailInfo info); +}; + +extern const char* kProtocolName; +extern const char* kProtocolSignature; + +#endif // IMKIT_MSNP_H diff --git a/protocols/msn/SettingsTemplate.rdef b/protocols/msn/SettingsTemplate.rdef new file mode 100644 index 0000000..2f20c4d --- /dev/null +++ b/protocols/msn/SettingsTemplate.rdef @@ -0,0 +1,19 @@ +resource(1000) message('IMst') { + "setting" = message { + "name" = "username", + "description" = "Username", + int32 "type" = 'CSTR' + }, + "setting" = message { + "name" = "password", + "description" = "Password", + int32 "type" = 'CSTR', + "is_secret" = true + }, + "setting" = message { + "name" = "resource", + "description" = "Resource", + int32 "type" = 'CSTR', + "default" = "Caya" + } +}; diff --git a/protocols/msn/main.cpp b/protocols/msn/main.cpp new file mode 100644 index 0000000..ba0b95c --- /dev/null +++ b/protocols/msn/main.cpp @@ -0,0 +1,25 @@ +#include "MSN.h" + +extern "C" __declspec(dllexport) CayaProtocol* protocol(); +extern "C" __declspec(dllexport) const char* signature(); +extern "C" __declspec(dllexport) const char* friendly_signature(); + +CayaProtocol* +protocol() +{ + return (CayaProtocol*)new MSNP(); +} + + +const char* +signature() +{ + return kProtocolSignature; +} + + +const char* +friendly_signature() +{ + return kProtocolName; +} diff --git a/protocols/msn/msn.rdef b/protocols/msn/msn.rdef new file mode 100644 index 0000000..c9cd175 --- /dev/null +++ b/protocols/msn/msn.rdef @@ -0,0 +1,42 @@ + +resource app_version { + major = 0, + middle = 0, + minor = 0, + + variety = B_APPV_ALPHA, + internal = 0, + + short_info = "MSN Messenger Protocol for Caya", + long_info = "©2009-2010 Dario Casalinuovo" +}; + +resource vector_icon { + $"6E636966070200060238C0BEBA7E0B3A7E0B38C0BE48D8C64A1C0A0194CBEED9" + $"007FC50200060239209E39209EB9209E39209E487FFF4AEBEC00007FC58800A9" + $"4F02000603B97CC8BA70F23A70F2B97CC84AA9AE4AE5EA0000A94F7B61BD65FF" + $"A1D07E02000602B44F83BABC1B3ABC1BB44F834BC9BA4AC8C100F4A6567EFCCA" + $"25020006023B48000000000000003B64004AE0004B00004AF4A656FFE95A2F02" + $"0006023C00000000000000003C00004AE0004A400004F4A65689E95A2F020106" + $"02360EABB34A1839C88F3C5DC44A10924A42F8FF3E5BA6006D7CBC070206BE5F" + $"BEBDBBAFBF6FBE4EBE66BE35BDBABE40BE0FBBFABBA5B635B92BB8BDB9EAB57A" + $"B8F4B418B958B493B8D1B3B631B443BB93B3D3BA96B5C3BEFEBB42C4BEB888C2" + $"9FBAA9C1E90207C048C43FC05AC460BF74C2D1BE5FBEBDBEBEC0B9BBAFBF6FBB" + $"42C4BEBAA9C1E9BB42C4BFBB42C4BEBB42C4BEBB9DC505BC53C574BC04C54BBD" + $"C5C635BF8DC597BEBAC60FBFE2C568C082C4A0C04C4DC06FC4800209BF8DC597" + $"BFE2C568BEBAC60FBC53C574BDC5C635BC04C54BBB42C4BEBB9DC505BB42C4BE" + $"BB42C4BEBB42C4BFBC5CC791C03DCAC8BE07C995C0A2CAFDC163CADDC101CB0D" + $"C1A6CABDC1DECA48C1CBCA73C237C974C277C71DC262C875C1B8C659C082C4A0" + $"C110C583C04C4D0208CA79C0F3CB37C44DCA3FC192C99BC2C1CA0BC206C8F2C3" + $"DAC66CC4A8C7C5C482C531C4CBC22EC409C386C490C263C507C277C71DC27CC6" + $"0FC36BC80CC5CCC981C48AC8E0C604C99DC688C9B0C64AC9B0C6E8C9B0C792C9" + $"4BC742C98BC9D0C7820206BFD5BE3CC2D7BD02C0D4BFF0C20BC373C1A6C1E6C2" + $"18C3A4C22EC409C223C3D7C386C490C66CC4A8C531C4CBC7C5C482C99BC2C1C8" + $"F2C3DACA0BC206CA79C0F3CA3FC192C854BCF90206CAC1B705CC42BA33CA8AB6" + $"90C9C127CA2CB60BC8F1B54CC6EAB5D1C7ECB556C3B7B759BF54BD6CC05BBA16" + $"BF80BDAFBFD5BE3CBFABBDF5C2D7BD02CA79C0F3C854BCF9CB85BE0F0206BE31" + $"BD99BE7ABFE3BE27BD3FBE79BCD6BE3CBCEDBEB1BCC0BF28BD2BBEF9BCE4C074" + $"BF0FC20BC373C190C191C258C49EC277C71DC27DC5D9C19DC63EC048C43FC0E1" + $"C547BF4947070A000100000A010101000A020102000A030103000A040104000A" + $"050105000A06010600" +}; \ No newline at end of file