Hi
I first thought I had the same problem as Christopher Jimenez but now
I've read his mails a bit better =)
I use the WengoPhone with a Jabber server (jabberd 1.4) and found the
following reproducable issue:
- If someone adds me to the contactlist then the authorization-request
comes up. After this the "Add Contact" window is opened where I can put
in the contact details. The problem now is: After having saved this
account I have the account doubled in my buddy-list! But: One contact is
online, the other isn't. If I now want to remove one of this accounts,
the other person can no longer see my presence-state because by deleting
an account WengoPhone tells the jabber-server to remove the
authorization.
After experimenting a bit I found out the reason for this behaviour, it
has to do with the following code:
(/wengophone/src/presentation/qt/profile/QtUserProfile.cpp, lines
138ff)
int buttonClicked = QMessageBox::question(_qtWengoPhone.getWidget(),
tr("WengoPhone - Authorization Request"), request,
tr("&Authorize"), tr("&Block"));
if (buttonClicked == 0) {
//TODO: give a personal message
sender->authorizeContact(imContact, true, String::null);
if
(_cUserProfile.getCContactList().findContactThatOwns(imContact).empty())
{
//If the contact is not in our ContactList
ContactProfile contactProfile;
contactProfile.addIMContact(imContact);
QtProfileDetails qtProfileDetails(_cUserProfile,
contactProfile, _qtWengoPhone.getWidget(), tr("Edit Contact"));
if (qtProfileDetails.show()) {
_cUserProfile.getCContactList().addContact(contactProfile);
}
}
}
1. The request comes to me, I authorize the contact
2. The authorization is reported to the server that automatically adds
the contact to my server-buddy-list
3. The contact window is opened
4. WHILE I'm typing in the details WengoPhone recognizes that there is a
new account on the server-buddy-list and saves it locally. So the
contact is on my list before I saved the new contact (the sync doesn't
take a long time, only 1-2 seconds)
5. In this situation WengoPhone seems not to recognize that the contact
is already there, so it's two times on my buddy-list.
Solution: I just put "sender->authorizeContact(imContact, true,
String::null);" after the addContact-code, my Code now looks as follows
and WengoPhone behaves as expected:
if (buttonClicked == 0) {
//TODO: give a personal message
if
(_cUserProfile.getCContactList().findContactThatOwns(imContact).empty())
{
//If the contact is not in our ContactList
ContactProfile contactProfile;
contactProfile.addIMContact(imContact);
QtProfileDetails qtProfileDetails(_cUserProfile,
contactProfile, _qtWengoPhone.getWidget(), tr("Edit Contact"));
if (qtProfileDetails.show()) {
_cUserProfile.getCContactList().addContact(contactProfile);
}
}
sender->authorizeContact(imContact, true, String::null);
}
=> This way the server nows about the authorization AFTER the contact is
on my buddy-list. If now the server adds it to the list itself
WengoPhone recognizes that this contact already exists and so now
doubled buddies are created!
Cheers, Pirmin
_______________________________________________
Wengophone-devel mailing list
[email protected]
http://dev.openwengo.com/mailman/listinfo/wengophone-devel