soc.2009.transport: ac092dad: Gloox filetransfer patch is now in gloox...
hanzz at soc.pidgin.im
hanzz at soc.pidgin.im
Wed Jul 29 08:55:57 EDT 2009
-----------------------------------------------------------------
Revision: ac092dad69d9218c77000a319f8b77da5a244b79
Ancestor: 3c2fb48e2f35b77ecd10f3c6a979d05507ffa733
Author: hanzz at soc.pidgin.im
Date: 2009-07-29T12:50:35
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/ac092dad69d9218c77000a319f8b77da5a244b79
Deleted entries:
patches/01-gloox-filetransfer-component.diff
Modified files:
filetransfermanager.cpp muchandler.cpp muchandler.h
protocols/irc.cpp
ChangeLog:
Gloox filetransfer patch is now in gloox-1.0 and gloox-trunk, so you need vanilla gloox-1.0 or gloox from trunk to compile the transport
-------------- next part --------------
============================================================
--- filetransfermanager.cpp 8ea55fce1a2df5e83503c949580b8c81e32d8d4b
+++ filetransfermanager.cpp a3f3202d37b92ed1316c84d9f0a1eb9cf620bb57
@@ -30,7 +30,7 @@ void FileTransferManager::handleFTReques
std::cout << "Received file transfer request from " << from.full() << " " << to.full() << " " << sid << ".\n";
m_info[sid].filename = name;
m_info[sid].size = size;
- m_sip->acceptFT(from, to, sid);
+ m_sip->acceptFT(from, sid, SIProfileFT::FTTypeS5B, to);
}
@@ -81,7 +81,7 @@ void FileTransferManager::sendFile(std::
return;
}
std::cout << "requesting filetransfer " << jid <<" " << file <<" as " << name << " " << info.st_size << "\n";
- std::string sid = m_sip->requestFT(jid, from, name, info.st_size);
+ std::string sid = m_sip->requestFT(jid, name, info.st_size, EmptyString, EmptyString, EmptyString, EmptyString, SIProfileFT::FTTypeAll, from);
m_info[sid].filename = file;
m_info[sid].size = info.st_size;
f.close();
============================================================
--- muchandler.cpp 6019a7d276737e2f06038197b4f7985efbcd45bf
+++ muchandler.cpp 6298e0ca022a8262ba66828874e910b11cd372d7
@@ -34,13 +34,17 @@ Tag * MUCHandler::handlePresence(const P
MUCHandler::~MUCHandler() {}
Tag * MUCHandler::handlePresence(const Presence &stanza) {
-// Presence tag(stanza.presence(), m_jid, stanza.status());
-// tag.setFrom(p->jid());
+ Tag *ret;
+ Tag *stanzaTag = stanza.tag();
+ ret = handlePresence(stanzaTag);
+ delete stanzaTag;
+ return ret;
+}
-// return tag.tag();
- if (stanza.presence() != Presence::Unavailable) {
+Tag * MUCHandler::handlePresence(Tag *stanza) {
+ if (stanza->findAttribute("type") != "unavailable") {
GHashTable *comps = NULL;
- std::string name = stanza.to().username();
+ std::string name = JID(stanza->findAttribute("to")).username();
PurpleConnection *gc = purple_account_get_connection(m_user->account());
if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL) {
if (name.find("%") != std::string::npos)
============================================================
--- muchandler.h a3a36e9c901b3450ddcf98a05de933729aa82b8f
+++ muchandler.h f68bd8242a5ba1edc5cf6843605b8f12c3f453f9
@@ -37,6 +37,7 @@ class MUCHandler
MUCHandler(User *user,const std::string &jid, const std::string &userJid);
~MUCHandler();
Tag * handlePresence(const Presence &stanza);
+ Tag * handlePresence(Tag *stanza);
void addUsers(GList *cbuddies);
void messageReceived(const char *who, const char *msg, PurpleMessageFlags flags, time_t mtime);
void renameUser(const char *old_name, const char *new_name, const char *new_alias);
============================================================
--- protocols/irc.cpp bfeefaf6abd4ab8ddfaf9b764b234674d35370c5
+++ protocols/irc.cpp 8affcec1ce7e8d6facee4f75d1c0dc97e4770fb3
@@ -85,9 +85,9 @@ void IRCProtocol::onConnected(User *user
}
for (std::list <Tag*>::iterator it = data->autoConnectRooms.begin(); it != data->autoConnectRooms.end() ; it++ ) {
- Presence stanza((*it));
- MUCHandler *muc = new MUCHandler(user, stanza.to().bare(), stanza.from().full());
- g_hash_table_replace(user->mucs(), g_strdup(stanza.to().username().c_str()), muc);
+ Tag *stanza = (*it);
+ MUCHandler *muc = new MUCHandler(user, JID(stanza->findAttribute("to")).bare(), JID(stanza->findAttribute("from")).full());
+ g_hash_table_replace(user->mucs(), g_strdup(JID(stanza->findAttribute("to")).username().c_str()), muc);
Tag * ret = muc->handlePresence(stanza);
if (ret)
m_main->j->send(ret);
More information about the Commits
mailing list