On Tue, 16 May 2006 21:35:51 +0200, Jan Ritzerfeld <[EMAIL PROTECTED]> wrote:
> Am Montag, 15. Mai 2006 08:52 schrieb Olivier Goffart: > >> Le Lundi 15 Mai 2006 00:48, Jan Ritzerfeld a écrit : >> > Hey... >> > >> > I'm not quite sure wether this commit won't break some code: >> > | r540784 | rjarosz | 2006-05-14 17:23:58 +0200 (So, 14 Mai 2006) | 3 >> > | lines >> > | >> > | Compare more values >> > >> > The semantics was changed and the operator== won't do what is still >> > promised in libkopete/kopeteonlinestatus.h:353: >> > /** >> > * Comparison operator >> > * >> > * Returns true if both the protocol and the internal status >> > are * identical. >> > */ >> > bool operator==( const OnlineStatus &other ) const; >> >> Then the documentation probably need to be changed. >> >> This was committed in order to fix a bug where the status icon were not >> updated in oscar i think. >> [...] > > I am pretty sure that it breaks some code. There is a new bug report: > http://bugs.kde.org/show_bug.cgi?id=127464 > "After starting Kopete ICQ always connects with status 'Do not disturb' > and invisible flag set" > And this report describes what I experienced before I added some checks > to protocols/oscar/icq/icqaccount.cpp and > protocols/oscar/icq/icqpresence.cpp some months ago. These checks rely > on the original semantics of operator==, they compare a passed status > object with the default constructed KOS object. This ensures that it isn't > a libkopete builtin status object created outside of the icq protocol. > Trying to convert such a KOS object into an ICQ::Presenceobject by > presenceOf() won't work. I found an old kopete mailinglist post of mine > explaining what would happen: > | [...] using global "Set Status"->"Online" will put the icq account to > | dnd/invisble instead of online: Kopete::Account::connect( const > ^^^^^^^^^^^^ > | Kopete::OnlineStatus& initialStatus = OnlineStatus() ) > | in kopeteaccount.h is called and so > | Kopete::PasswordedAccount::connect( const Kopete::OnlineStatus& > | initialStatus ) with an invalid initialStatus. Converting this in > | ICQAccount::connectWithPassword with ICQ::Presence::fromOnlineStatus to a > | presence and this to an OscarStatus with toOscarStatus will result in the > | OFFLINE OscarStatus (-1) with all flags set. A check for such KOS in > | ICQAccount::connectWithPassword and Presence::fromOnlineStatus, the new > | method PresenceTypeData::forOnlineStatusType which returns a suitable > | PresenceTypeData for the given KOS fixed that. > > protocols/oscar/icq/icqpresence.cpp:238: > Presence Presence::fromOnlineStatus( const Kopete::OnlineStatus &status ) > { > if ( status != Kopete::OnlineStatus() ) > { > OnlineStatusManager *store = > ICQProtocol::protocol()->statusManager(); > return store->presenceOf( status.internalStatus() ); > } > else > { > //status is a libkopete builtin status object > //don't even think about converting it to ICQ::Presence using > presenceOf! > return Presence( PresenceTypeData::forOnlineStatusType( > status.status() ).type, > Presence::Visible ); > } > } > > protocols/oscar/icq/icqaccount.cpp:146: > void ICQAccount::connectWithPassword( const QString &password ) > { > [...] > Kopete::OnlineStatus status = initialStatus(); > if ( status == Kopete::OnlineStatus() && > status.status() == Kopete::OnlineStatus::Unknown ) > //use default online in case of invalid online status for > connecting > status = Kopete::OnlineStatus( Kopete::OnlineStatus::Online ); > ICQ::Presence pres = ICQ::Presence::fromOnlineStatus( status ); > [...] > } > > Gruß > Jan > > I'm sorry if I broke something. Should I revert this change, because I don't understand much ICQ Presence. I added this because when I add contact that is not in my contact list to list and that contact require authorization than icon is still shown as offline. Roman Jarosz _______________________________________________ kopete-devel mailing list [email protected] https://mail.kde.org/mailman/listinfo/kopete-devel
