[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise
From: Will Stephenson <wstephenson () kde ! org>
Date: 2007-05-24 23:19:31
Message-ID: 1180048771.342002.30342.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 668060 by wstephens:
Enable Kopete to respond to chats started by others who are
blocking you (Novell bug #267832)
M +12 -0 gwaccount.cpp
M +14 -2 gwcontact.cpp
M +10 -0 gwcontact.h
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/gwaccount.cpp \
#668059:668060 @@ -790,6 +790,13 @@
if ( !sender )
sender = createTemporaryContact( message.user );
+ // if we receive a message from an Offline contact, they are probably blocking \
us + // but we have to set their status to Unknown so that we can reply to them.
+ kdDebug( GROUPWISE_DEBUG_GLOBAL) << "sender is: " << \
sender->onlineStatus().description() << endl; + if ( sender->onlineStatus() == \
protocol()->groupwiseOffline ) { + sender->setMessageReceivedOffline( true );
+ }
+
Kopete::ContactPtrList contactList;
contactList.append( sender );
// FIND A MESSAGE MANAGER FOR THIS CONTACT
@@ -1352,6 +1359,11 @@
m_client->leaveConference( sess->guid() );
m_chatSessions.remove( sess );
kdDebug( GROUPWISE_DEBUG_GLOBAL ) << k_funcinfo << "m_chatSessions now contains:" \
<< m_chatSessions.count() << " managers" << endl; + Kopete::ContactPtrList members = \
sess->members(); + for ( Kopete::Contact * contact = members.first(); contact; \
contact = members.next() ) + {
+ static_cast< GroupWiseContact * >( contact )->setMessageReceivedOffline( false );
+ }
}
void GroupWiseAccount::slotSetAutoReply()
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/gwcontact.cpp \
#668059:668060 @@ -50,7 +50,7 @@
Kopete::MetaContact *parent,
const int objectId, const int parentId, const int sequence )
: Kopete::Contact( account, GroupWiseProtocol::dnToDotted( dn ), parent ), \
m_objectId( objectId ), m_parentId( parentId ),
- m_sequence( sequence ), m_actionBlock( 0 ), m_archiving( false ), m_deleting( \
false ) + m_sequence( sequence ), m_actionBlock( 0 ), m_archiving( false ), \
m_deleting( false ), m_messageReceivedOffline( false ) {
if ( dn.find( '=' ) != -1 )
{
@@ -134,7 +134,7 @@
// in GWChatSession
// (This is a GroupWise rule, not a problem in Kopete)
- if ( account()->isConnected() && isOnline()/* && \
account()->myself()->onlineStatus() != protocol()->groupwiseAppearOffline */) + if ( \
account()->isConnected() && ( isOnline() || messageReceivedOffline() ) /* && \
account()->myself()->onlineStatus() != protocol()->groupwiseAppearOffline */) return \
true; if ( !account()->isConnected()/* || account()->myself()->onlineStatus() == \
protocol()->groupwiseAppearOffline*/ ) return false;
@@ -227,6 +227,7 @@
void GroupWiseContact::setOnlineStatus( const Kopete::OnlineStatus& status )
{
+ setMessageReceivedOffline( false );
if ( status == protocol()->groupwiseAwayIdle && status != onlineStatus() )
setIdleTime( 1 );
else if ( onlineStatus() == protocol()->groupwiseAwayIdle && status != \
onlineStatus() ) @@ -299,6 +300,17 @@
else
kdDebug( GROUPWISE_DEBUG_GLOBAL ) << k_funcinfo << "rename failed, return code: " \
<< uct->statusCode() << endl; }
+
+void GroupWiseContact::setMessageReceivedOffline( bool on )
+{
+ m_messageReceivedOffline = on;
+}
+
+bool GroupWiseContact::messageReceivedOffline() const
+{
+ return m_messageReceivedOffline;
+}
+
#include "gwcontact.moc"
// vim: set noet ts=4 sts=4 sw=4:
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/gwcontact.h #668059:668060
@@ -130,6 +130,15 @@
* Mark this contact as being deleted
*/
void setDeleting( bool deleting );
+ /**
+ * Marks this contact as having sent a message whilst apparently offline
+ */
+ void setMessageReceivedOffline( bool on );
+ /**
+ * Has this contact sent a message whilst apparently offline?
+ */
+ bool messageReceivedOffline() const;
+
public slots:
/**
* Transmits an outgoing message to the server
@@ -179,6 +188,7 @@
// HACK: flag used to differentiate between 'all contact list instances gone while \
we are moving on the server' // and 'all contact list instances gone because we \
wanted to delete them all' bool m_deleting;
+ bool m_messageReceivedOffline;
};
#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic