Libtransport: Do not send subscribe presences from full JID
This commit is contained in:
parent
093daf2feb
commit
6eb53393c7
3 changed files with 4 additions and 3 deletions
|
@ -14,8 +14,8 @@ admin_password=test
|
||||||
#cert_password=test #password to that certificate if any
|
#cert_password=test #password to that certificate if any
|
||||||
users_per_backend=10
|
users_per_backend=10
|
||||||
#backend=../..//backends/swiften/spectrum2_swiften_backend
|
#backend=../..//backends/swiften/spectrum2_swiften_backend
|
||||||
#backend=../../backends/twitter/spectrum2_twitter_backend
|
backend=../../backends/twitter/spectrum2_twitter_backend
|
||||||
backend=/home/hanzz/code/libtransport/backends/libcommuni/spectrum2_libcommuni_backend
|
#backend=/home/hanzz/code/libtransport/backends/libcommuni/spectrum2_libcommuni_backend
|
||||||
protocol=prpl-jabber
|
protocol=prpl-jabber
|
||||||
#protocol=prpl-msn
|
#protocol=prpl-msn
|
||||||
#protocol=any
|
#protocol=any
|
||||||
|
|
|
@ -200,7 +200,7 @@ void RosterManager::sendBuddyUnsubscribePresence(Buddy *buddy) {
|
||||||
void RosterManager::sendBuddySubscribePresence(Buddy *buddy) {
|
void RosterManager::sendBuddySubscribePresence(Buddy *buddy) {
|
||||||
Swift::Presence::ref response = Swift::Presence::create();
|
Swift::Presence::ref response = Swift::Presence::create();
|
||||||
response->setTo(m_user->getJID());
|
response->setTo(m_user->getJID());
|
||||||
response->setFrom(buddy->getJID());
|
response->setFrom(buddy->getJID().toBare());
|
||||||
response->setType(Swift::Presence::Subscribe);
|
response->setType(Swift::Presence::Subscribe);
|
||||||
if (!buddy->getAlias().empty()) {
|
if (!buddy->getAlias().empty()) {
|
||||||
response->addPayload(boost::make_shared<Swift::Nickname>(buddy->getAlias()));
|
response->addPayload(boost::make_shared<Swift::Nickname>(buddy->getAlias()));
|
||||||
|
|
|
@ -70,6 +70,7 @@ class RosterManagerTest : public CPPUNIT_NS :: TestFixture, public BasicTest {
|
||||||
CPPUNIT_ASSERT_EQUAL(1, (int) received.size());
|
CPPUNIT_ASSERT_EQUAL(1, (int) received.size());
|
||||||
CPPUNIT_ASSERT(getStanza(received[0])->getPayload<Swift::Nickname>());
|
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("Buddy 1"), getStanza(received[0])->getPayload<Swift::Nickname>()->getNickname());
|
||||||
|
CPPUNIT_ASSERT_EQUAL(std::string("buddy1@localhost"), getStanza(received[0])->getFrom().toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue