Libtransport: Do not send subscribe presences from full JID

This commit is contained in:
Jan Kaluza 2013-03-19 15:18:03 +01:00
parent 093daf2feb
commit 6eb53393c7
3 changed files with 4 additions and 3 deletions

View file

@ -14,8 +14,8 @@ admin_password=test
#cert_password=test #password to that certificate if any
users_per_backend=10
#backend=../..//backends/swiften/spectrum2_swiften_backend
#backend=../../backends/twitter/spectrum2_twitter_backend
backend=/home/hanzz/code/libtransport/backends/libcommuni/spectrum2_libcommuni_backend
backend=../../backends/twitter/spectrum2_twitter_backend
#backend=/home/hanzz/code/libtransport/backends/libcommuni/spectrum2_libcommuni_backend
protocol=prpl-jabber
#protocol=prpl-msn
#protocol=any

View file

@ -200,7 +200,7 @@ void RosterManager::sendBuddyUnsubscribePresence(Buddy *buddy) {
void RosterManager::sendBuddySubscribePresence(Buddy *buddy) {
Swift::Presence::ref response = Swift::Presence::create();
response->setTo(m_user->getJID());
response->setFrom(buddy->getJID());
response->setFrom(buddy->getJID().toBare());
response->setType(Swift::Presence::Subscribe);
if (!buddy->getAlias().empty()) {
response->addPayload(boost::make_shared<Swift::Nickname>(buddy->getAlias()));

View file

@ -70,6 +70,7 @@ class RosterManagerTest : public CPPUNIT_NS :: TestFixture, public BasicTest {
CPPUNIT_ASSERT_EQUAL(1, (int) received.size());
CPPUNIT_ASSERT(getStanza(received[0])->getPayload<Swift::Nickname>());
CPPUNIT_ASSERT_EQUAL(std::string("Buddy 1"), getStanza(received[0])->getPayload<Swift::Nickname>()->getNickname());
CPPUNIT_ASSERT_EQUAL(std::string("buddy1@localhost"), getStanza(received[0])->getFrom().toString());
}