Chat without presence -- even if enabling sip.chat.without.presence did
not work for me when no presence info is available from the
infrastructure. The presence score in this case is 0 and the contact is
not found at all. This sets the initial score to -1 so that even if the
score is 0 the "best" contact is returned.

# HG changeset patch
# User Ralf Schlatterbeck <[EMAIL PROTECTED]>
# Date 1207323374 -7200
# Node ID cbf4f93be14e836932e0e3565c5e03b9920b458d
# Parent  ec973c76a4e74c289ab7758879d14663e0d1e749
Chat without presence -- even if enabling sip.chat.without.presence did 
not work for me when no presence info is available from the 
infrastructure. The presence score in this case is 0 and the contact is 
not found at all. This sets the initial score to -1 so that even if the 
score is 0 the "best" contact is returned.
Fix message when no presence is available:
UserProfile::startIM(Contact&): There is no IMContact available
This comes even if enabling sip.chat.without.presence in advance
config dialog.

diff -r ec973c76a4e7 -r cbf4f93be14e 
wengophone/src/model/contactlist/ContactProfile.cpp
--- a/wengophone/src/model/contactlist/ContactProfile.cpp       Fri Apr 04 
15:10:29 2008 +0200
+++ b/wengophone/src/model/contactlist/ContactProfile.cpp       Fri Apr 04 
17:36:14 2008 +0200
@@ -230,9 +230,9 @@ IMContact * ContactProfile::getPreferred
        const int offlineScore = 
getStateScore(EnumPresenceState::PresenceStateOffline);
 
        IMContact * bestIMContact = 0;
-       int bestIMContactScore = 0;
+       int bestIMContactScore = -1;
        IMContact * bestWengoContact = 0;
-       int bestWengoContactScore = 0;
+       int bestWengoContactScore = -1;
 
        // Find best IM contact and best Wengo contact
        IMContactSet::const_iterator
@@ -272,7 +272,7 @@ IMContact * ContactProfile::getPreferred
        if (_preferredIMContact) {
                preferredIMContactScore = 
getStateScore(_preferredIMContact->getPresenceState());
        } else {
-               preferredIMContactScore = 0;
+               preferredIMContactScore = -1;
        }
 
        // Choose the best one
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  Fax:   +43/2243/26465-23
Reichergasse 131                        www:   http://www.runtux.com
A-3411 Weidling                         email: [EMAIL PROTECTED]
osAlliance member                       email: [EMAIL PROTECTED]
_______________________________________________
QuteCom-dev mailing list
[email protected]
http://lists.qutecom.org/mailman/listinfo/qutecom-dev

Reply via email to