[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/kopete/protocols/msn
From:       Olivier Goffart <ogoffart () tiscalinet ! be>
Date:       2003-05-26 12:44:32
[Download RAW message or body]

CVS commit by ogoffart: 

An user asked to me: "I would like to have a send email action in the 
msn contact's context menu."
My answer was: "let me 10 minutes"

and that's done :-)


  M +7 -0      msnaccount.cpp   1.23
  M +5 -0      msnaccount.h   1.8
  M +15 -1     msncontact.cpp   1.134
  M +1 -0      msncontact.h   1.90
  M +5 -0      msnnotifysocket.cpp   1.97
  M +2 -0      msnnotifysocket.h   1.34


--- kdenonbeta/kopete/protocols/msn/msnaccount.cpp  #1.22:1.23
@@ -1015,4 +1015,11 @@ bool MSNAccount::addContactToMetaContact
 }
 
+bool MSNAccount::isHotmail()
+{
+        if(!m_openInboxAction)
+                return false;
+        return m_openInboxAction->isEnabled();
+}
+
 #include "msnaccount.moc"
 

--- kdenonbeta/kopete/protocols/msn/msnaccount.h  #1.7:1.8
@@ -67,4 +67,9 @@ public:
                 { return m_awayReason; }
 
+        /**
+         * return true if we are able to send mail, or to open hotmail inbox
+         */
+        bool isHotmail();
+
 public slots:
         virtual void connect() ;

--- kdenonbeta/kopete/protocols/msn/msncontact.cpp  #1.133:1.134
@@ -79,11 +79,16 @@ KActionCollection *MSNContact::customCon
         // Block/unblock Contact
         QString label = isBlocked() ? i18n( "Unblock User" ) : i18n( "Block User" );
-        KAction* actionBlock = new KAction( label, "msn_blocked", this, SLOT( \
slotBlockUser() ), m_actionCollection, "actionBlock" ); +        KAction* actionBlock \
= new KAction( label, "msn_blocked",0, this, SLOT( slotBlockUser() ), \
m_actionCollection, "actionBlock" );  
         //show profile
         KAction* actionShowProfile = new KAction( i18n("Show Profile") , 0, this, \
SLOT( slotShowProfile() ), m_actionCollection, "actionShowProfile" );  
+        // Send mail (only available if it is an hotmail account)
+        KAction* actionSendMail = new KAction( i18n("Send Mail") , "mail_generic",0, \
this, SLOT( slotSendMail() ), m_actionCollection, "actionSendMail" ); +        \
actionSendMail->setEnabled( static_cast<MSNAccount*>(account())->isHotmail()); +
         m_actionCollection->insert( actionBlock );
         m_actionCollection->insert( actionShowProfile );
+        m_actionCollection->insert( actionSendMail );
 
         return m_actionCollection;
@@ -451,4 +456,13 @@ void MSNContact::setOnlineStatus(const K
                 else
                         KopeteContact::setOnlineStatus(status);
+        }
+}
+
+void MSNContact::slotSendMail()
+{
+        MSNNotifySocket *notify = static_cast<MSNAccount*>( account() \
)->notifySocket(); +        if( notify )
+        {
+                notify->sendMail( contactId() );
         }
 }

--- kdenonbeta/kopete/protocols/msn/msncontact.h  #1.89:1.90
@@ -128,4 +128,5 @@ private slots:
         void slotBlockUser();
         void slotShowProfile();
+        void slotSendMail();
 
 private:

--- kdenonbeta/kopete/protocols/msn/msnnotifysocket.cpp  #1.96:1.97
@@ -453,4 +453,9 @@ void MSNNotifySocket::slotOpenInbox()
 }
 
+void MSNNotifySocket::sendMail(const QString &email)
+{
+        sendCommand("URL", QString("COMPOSE " + email).utf8() );
+}
+
 void MSNNotifySocket::slotReadMessage( const QString &msg )
 {

--- kdenonbeta/kopete/protocols/msn/msnnotifysocket.h  #1.33:1.34
@@ -56,4 +56,6 @@ public:
         void createChatSession();
 
+        void sendMail(const QString &email);
+
 public slots:
         void slotOpenInbox();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic