Version: 0.15 (using KDE KDE 3.3.1) Installed from: Compiled From Sources Compiler: gcc 3.3.4 OS: Linux 1. Feature to send /me messages for away 2. Feature to set auto-away after n minutes 3. Set konversation away when locking KDE, like kopete does.
> 1. Feature to send /me messages for away Already possible. See File->Identies under Away. It's a bit obscure I admit :\ > 2. Feature to set auto-away after n minutes This is possibly the same as number 3. lock when screensaver comes on. > 3. Set konversation away when locking KDE, like kopete does. I have implemented this just now. will commit after testing.
CVS commit by johnflux: Add infrastructure needed to support auto-away. CCBUG:95419 M +17 -0 konvdcop.cpp 1.35 M +2 -0 konvdcop.h 1.27 M +15 -1 konversationapplication.cpp 1.211 M +1 -0 konversationapplication.h 1.54 M +1 -0 konviface.h 1.28 M +6 -1 server.cpp 1.404 M +8 -0 server.h 1.189
Update for this.. The problem isn't auto-away, the problem is coming back online. What needs to be done is to copy the code from kopete (or elsewhere - cartman has his own preferences) to detect when the mouse has moved. I really wish there was a better way to know when they are back online.
> ------- Additional Comments From johnflux hotmail com 2005-01-04 12:05 > ------- Update for this.. > > The problem isn't auto-away, the problem is coming back online. What needs > to be done is to copy the code from kopete (or elsewhere - cartman has his > own preferences) to detect when the mouse has moved. Feel free to use Kopete's code as I am busy with other stuff now. We can enhance it later.
Doesn't KDE have something like this built in, to e.g. activate the screensaver and such? Kopete sets me away when I lock my session, too.
*** This bug has been confirmed by popular vote. ***
I'm comitting to implementing per-identity configurable auto-away triggered by n minutes of inactivity or screensaver activation with optional return on activity for the next release, which will be Konversation 1.1 in early 2007. Assigning.
Implemented as of SVN revision 814915.
commit 08458611e504ab107ca65a11dac127b54b54a00d Author: John Tapsell <john.tapsell@kdemail.net> Date: Sun Dec 19 19:07:24 2004 +0000 Add infrastructure needed to support auto-away. CCBUG:95419 svn path=/trunk/kdeextragear-2/konversation/; revision=372006 diff --git a/konversation/konvdcop.cpp b/konversation/konvdcop.cpp index 282d0d0..b423e72 100644 --- a/konversation/konvdcop.cpp +++ b/konversation/konvdcop.cpp @@ -36,6 +36,19 @@ KonvDCOP::KonvDCOP() kapp->dcopClient()->registerAs("konversation"); kapp->dcopClient()->setDefaultObject(objId()); } + KConfig *config = KGlobal::config(); + config->setGroup("AutoAway"); //TODO - add this to preferences somewhere + + if (config->readBoolEntry("UseAutoAway", true)) + { + connectDCOPSignal("kdesktop", "KScreensaverIface", + "KDE_start_screensaver()", "setAutoAway()", false); + } + else + { + disconnectDCOPSignal("kdesktop", "KScreensaverIface", + "KDE_start_screensaver()", "setAutoAway()"); + } } void KonvDCOP::raw(const QString& server,const QString& command) @@ -52,6 +65,10 @@ void KonvDCOP::setAway(const QString &awaymessage) else emit dcopMultiServerRaw("away " + awaymessage); } +void KonvDCOP::setAutoAway() +{ + emit setAutoAway(); +} void KonvDCOP::setBack() { emit dcopMultiServerRaw("away"); diff --git a/konversation/konvdcop.h b/konversation/konvdcop.h index 409b714..e5e5632 100644 --- a/konversation/konvdcop.h +++ b/konversation/konvdcop.h @@ -26,12 +26,14 @@ class KonvDCOP : public QObject, virtual public KonvIface void dcopConnectToServer(const QString& url, int port, const QString& channel, const QString& password); void dcopRaw(const QString& server, const QString& command); void dcopMultiServerRaw(const QString& command); + void dcopSetAutoAway(); public slots: int registerEventHook(const QString& type,const QString& criteria,const QString& app,const QString& object,const QString& signal); void unregisterEventHook (int id); void setAway(const QString &awaymessage); + void setAutoAway(); void setBack(); void sayToAll(const QString &message); void actionToAll(const QString &message); diff --git a/konversation/konversationapplication.cpp b/konversation/konversationapplication.cpp index 5ea0b7b..92d3887 100644 --- a/konversation/konversationapplication.cpp +++ b/konversation/konversationapplication.cpp @@ -128,7 +128,9 @@ KonversationApplication::KonversationApplication() connect(dcopObject,SIGNAL (dcopInfo(const QString&)), this,SLOT (dcopInfo(const QString&)) ); connect(dcopObject,SIGNAL (dcopInsertRememberLine()), - this,SLOT(insertRememberLine())); + this,SLOT (insertRememberLine())); + connect(dcopObject,SIGNAL (dcopSetAutoAway()), + this,SLOT (setAutoAway())); connect(dcopObject,SIGNAL(dcopConnectToServer(const QString&, int,const QString&, const QString&)), this,SLOT(dcopConnectToServer(const QString&, int,const QString&, const QString&))); } @@ -158,6 +160,18 @@ KonversationMainWindow *KonversationApplication::getMainWindow() { return mainWindow; } +void KonversationApplication::setAutoAway() +{ + Server* lookServer=serverList.first(); + while(lookServer) + { + if(!lookServer->isAway()) { + lookServer->setAutoAway(); + } + lookServer=serverList.next(); + } + +} void KonversationApplication::toggleAway() { kdDebug() << "toggleAway()" << endl; diff --git a/konversation/konversationapplication.h b/konversation/konversationapplication.h index ca9b5e7..a519e74 100644 --- a/konversation/konversationapplication.h +++ b/konversation/konversationapplication.h @@ -147,6 +147,7 @@ class KonversationApplication : public KApplication void dcopRaw(const QString& server, const QString &command); void dcopSay(const QString& server,const QString& target,const QString& command); void dcopInfo(const QString& string); + void setAutoAway(); void insertRememberLine(); void appearanceChanged(); void sendMultiServerCommand(const QString& command, const QString& parameter); diff --git a/konversation/konviface.h b/konversation/konviface.h index 828cc66..258c763 100644 --- a/konversation/konviface.h +++ b/konversation/konviface.h @@ -14,6 +14,7 @@ class KonvIface : virtual public DCOPObject k_dcop: virtual void setAway(const QString &awaymessage) = 0; + virtual void setAutoAway() = 0; virtual void setBack() = 0; virtual void sayToAll(const QString &message) = 0; virtual void actionToAll(const QString &message) = 0; diff --git a/konversation/server.cpp b/konversation/server.cpp index 6486dd4..c7826bf 100644 --- a/konversation/server.cpp +++ b/konversation/server.cpp @@ -2849,7 +2849,12 @@ void Server::away() } } - +void Server::setAutoAway() { + kdDebug() << "going autoaway!" << endl; + m_isAutoAway = true; + //note that we now need to tell the server we are away. m_isAway is set when we get a reply from the server saying we are now away. + executeMultiServerCommand("away", i18n("Gone away for now.")); //fix this to use a prefered auto-away string. +} void Server::unAway() { m_isAway=false; diff --git a/konversation/server.h b/konversation/server.h index e0f08e6..aacfb97 100644 --- a/konversation/server.h +++ b/konversation/server.h @@ -281,7 +281,14 @@ class Server : public QObject * If we are not away, returns 00:00:00 */ QString awayTime() const; + /** Does the _server_ think we are away. Note that if we went auto-away when not connected to the server, this may + * return false. + */ bool isAway() const; + /** Put the server in autoaway. This means that when there is mouse activity, we will set to available again + * @see isAway + */ + void setAutoAway(); void emitChannelNickChanged(const ChannelNickPtr channelNick); void emitNickInfoChanged(const NickInfoPtr nickInfo); @@ -584,6 +591,7 @@ class Server : public QObject ChannelListPanel* channelListPanel; bool m_isAway; + bool m_isAutoAway; ///Note that this may be true, but m_isAway is false, if we go auto-away when disconnected. bool alreadyConnected; bool rejoinChannels; bool sendUnlocked;
*** Bug 496180 has been marked as a duplicate of this bug. ***