Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0823ec1137 | |||
| 1c4ebcccd1 | |||
| 9fd7e99274 | |||
| bf567146d8 | |||
| 3bade98d2f |
+2
-1
@@ -23,6 +23,7 @@ find_package(KF6 REQUIRED COMPONENTS
|
||||
ConfigWidgets
|
||||
CoreAddons
|
||||
Crash
|
||||
DBusAddons
|
||||
IdleTime
|
||||
I18n
|
||||
IconThemes
|
||||
@@ -55,7 +56,7 @@ else()
|
||||
set(KMESS_DISABLE_LIKEBACK 0)
|
||||
endif()
|
||||
|
||||
set(KMESS_VERSION "6.0_alpha4")
|
||||
set(KMESS_VERSION "6.0_alpha6")
|
||||
set(KMESS_ENABLE_DEBUG_OUTPUT 0)
|
||||
set(KMESS_BUILT_DEBUGFULL FALSE)
|
||||
set(HAVE_LIBISFQT 1)
|
||||
|
||||
@@ -169,6 +169,7 @@ SET(kmess_LIBS
|
||||
KF6::Completion
|
||||
KF6::CoreAddons
|
||||
KF6::Crash
|
||||
KF6::DBusAddons
|
||||
KF6::IdleTime
|
||||
KF6::I18n
|
||||
KF6::IconThemes
|
||||
|
||||
+18
-2
@@ -1672,8 +1672,16 @@ Chat *ChatMaster::createChat( MsnSwitchboardConnection *switchboard, bool reques
|
||||
Chat *newChat;
|
||||
ChatWindow *newChatWindow;
|
||||
|
||||
// If the new chat is a group chat, find existing group chat windows; else find private chats
|
||||
const QStringList partecipants( switchboard->getContactsInChat() );
|
||||
// If the new chat is a group chat, find existing group chat windows; else find private chats.
|
||||
// Escargot can briefly request a chat window while the switchboard has no resolved contact yet.
|
||||
QStringList partecipants( switchboard->getContactsInChat() );
|
||||
partecipants.removeAll( QString() );
|
||||
if( partecipants.isEmpty() )
|
||||
{
|
||||
kmWarning() << "Ignoring chat window request without contacts.";
|
||||
return 0;
|
||||
}
|
||||
|
||||
newChat = getContactsChat( partecipants, true );
|
||||
|
||||
// If the chat was requested by a contact, check if we have a chat request
|
||||
@@ -1728,11 +1736,18 @@ Chat *ChatMaster::createChat( MsnSwitchboardConnection *switchboard, bool reques
|
||||
if( ! newChat->initialize( switchboard ) )
|
||||
{
|
||||
kmDebug() << "Couldn't initialize the chat tab.";
|
||||
delete newChat;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Select the chat window where to open the new tab, or create a new one
|
||||
newChatWindow = createChatWindow( newChat );
|
||||
if( newChatWindow == 0 )
|
||||
{
|
||||
kmWarning() << "Couldn't create the chat window.";
|
||||
delete newChat;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Create the first tab in the chat
|
||||
newChat = newChatWindow->addChatTab( newChat, switchboard->getUserStartedChat() );
|
||||
@@ -1804,6 +1819,7 @@ ChatWindow *ChatMaster::createChatWindow( Chat *chat )
|
||||
if( ! window->initialize() )
|
||||
{
|
||||
kmWarning() << "Couldn't initialize the new chat window!";
|
||||
delete window;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+33
-18
@@ -192,10 +192,6 @@ ChatWindow::ChatWindow( QWidget *parent )
|
||||
connect( inkPenSize_, SIGNAL( valueChanged(int) ),
|
||||
inkCanvas_, SLOT ( setPenSize(int) ) );
|
||||
|
||||
// Connect the message edit so that if its displayed color changes,
|
||||
// it's checked to match the user's chosen color.
|
||||
connect( messageEdit_, SIGNAL( currentColorChanged(const QColor&) ),
|
||||
this, SLOT ( editorColorChanged(const QColor&) ) );
|
||||
// Connect the docks signals
|
||||
connect( standardEmoticonsDock_, SIGNAL( visibilityChanged(bool) ),
|
||||
this, SLOT ( slotEmoticonDocksToggled() ) );
|
||||
@@ -260,6 +256,10 @@ ChatWindow::~ChatWindow()
|
||||
// Add a new chat tab
|
||||
Chat *ChatWindow::addChatTab( Chat *newChat, bool foreground )
|
||||
{
|
||||
// QTabWidget emits currentChanged() from addTab(). Parent the contacts widget first
|
||||
// so slotTabChanged() never sees a half-attached chat view.
|
||||
newChat->getContactsWidget()->setParent( contactsDock_ );
|
||||
|
||||
// Connect its main signals
|
||||
connect( newChat, SIGNAL( chatInfoChanged() ),
|
||||
this, SLOT ( slotUpdateChatInfo() ) );
|
||||
@@ -280,10 +280,6 @@ Chat *ChatWindow::addChatTab( Chat *newChat, bool foreground )
|
||||
chatTabs_->setCurrentIndex( newTabIndex );
|
||||
}
|
||||
|
||||
// Set the appropriate parent of the contactswidget.
|
||||
// This is needed when a chat is moved to another window.
|
||||
newChat->getContactsWidget()->setParent( contactsDock_ );
|
||||
|
||||
// Apply the window's settings to the tab
|
||||
newChat->getContactsWidget()->setDockWidget( contactsDock_, dockWidgetArea( contactsDock_ ) );
|
||||
newChat->setZoomFactor( zoomLevel_ );
|
||||
@@ -501,13 +497,6 @@ void ChatWindow::createMenus()
|
||||
nextTabAction_->setText ( i18n("Ne&xt Tab") );
|
||||
nextTabAction_->setIconText( i18n("Ne&xt Tab") );
|
||||
|
||||
// Enable some default action shortcuts (preserve the original ones where needed)
|
||||
nudgeAction_->setShortcut( QKeySequence( "Alt+Z" ) );
|
||||
closeAction->setShortcuts( QList<QKeySequence>() << QKeySequence( "Ctrl+W" ) << closeAction->shortcut() );
|
||||
closeAllAction_->setShortcuts( QList<QKeySequence>() << QKeySequence( "Ctrl+Q" ) << closeAllAction_->shortcut() );
|
||||
prevTabAction_->setShortcuts( QList<QKeySequence>() << QKeySequence( QKeySequence::PreviousChild ) << prevTabAction_->shortcut() );
|
||||
nextTabAction_->setShortcuts( QList<QKeySequence>() << QKeySequence( QKeySequence::NextChild ) << nextTabAction_->shortcut() );
|
||||
|
||||
// Set up the dock actions
|
||||
contactsDockAction = contactsDock_ ->toggleViewAction();
|
||||
standardEmoticonsDockAction = standardEmoticonsDock_->toggleViewAction();
|
||||
@@ -517,19 +506,16 @@ void ChatWindow::createMenus()
|
||||
contactsDockAction->setToolTip( i18n("Enable or disable the contacts panel") );
|
||||
contactsDockAction->setText( i18nc("Toolbar button","Contacts") );
|
||||
contactsDockAction->setIconText( i18nc("Toolbar button","Contacts") );
|
||||
contactsDockAction->setShortcut( QKeySequence( "Ctrl+D" ) );
|
||||
|
||||
standardEmoticonsDockAction->setIcon( QIcon::fromTheme( "face-smile" ) );
|
||||
standardEmoticonsDockAction->setToolTip( i18n("Enable or disable the standard emoticons panel") );
|
||||
standardEmoticonsDockAction->setText( i18nc("Toolbar button","Emoticons") );
|
||||
standardEmoticonsDockAction->setIconText( i18nc("Toolbar button","Emoticons") );
|
||||
standardEmoticonsDockAction->setShortcut( QKeySequence( "Ctrl+E" ) );
|
||||
|
||||
customEmoticonsDockAction->setIcon( QIcon::fromTheme( "face-smile-gearhead-female" ) );
|
||||
customEmoticonsDockAction->setToolTip( i18n("Enable or disable the custom emoticons panel") );
|
||||
customEmoticonsDockAction->setText( i18nc("Toolbar button","My Emoticons") );
|
||||
customEmoticonsDockAction->setIconText( i18nc("Toolbar button","My Emoticons") );
|
||||
customEmoticonsDockAction->setShortcut( QKeySequence( "Ctrl+Y" ) );
|
||||
|
||||
// Add the dock toggling actions to the Panels menu
|
||||
panelsMenuAction_->addAction( contactsDockAction );
|
||||
@@ -601,6 +587,30 @@ void ChatWindow::createMenus()
|
||||
|
||||
// Add actions to actionCollection for "Settings" menu
|
||||
actionCollection_->addAction( "spellCheck", spellCheckAction_ );
|
||||
|
||||
// Enable some default action shortcuts (preserve the original ones where needed)
|
||||
auto defaultShortcuts = []( const QKeySequence &preferred, const QKeySequence &fallback )
|
||||
{
|
||||
QList<QKeySequence> shortcuts;
|
||||
if( ! preferred.isEmpty() )
|
||||
{
|
||||
shortcuts << preferred;
|
||||
}
|
||||
if( ! fallback.isEmpty() && ! shortcuts.contains( fallback ) )
|
||||
{
|
||||
shortcuts << fallback;
|
||||
}
|
||||
return shortcuts;
|
||||
};
|
||||
|
||||
actionCollection_->setDefaultShortcut( nudgeAction_, QKeySequence( "Alt+Z" ) );
|
||||
actionCollection_->setDefaultShortcut( closeAction, QKeySequence( "Ctrl+W" ) );
|
||||
actionCollection_->setDefaultShortcut( closeAllAction_, QKeySequence( "Ctrl+Q" ) );
|
||||
actionCollection_->setDefaultShortcuts( prevTabAction_, defaultShortcuts( QKeySequence( QKeySequence::PreviousChild ), prevTabAction_->shortcut() ) );
|
||||
actionCollection_->setDefaultShortcuts( nextTabAction_, defaultShortcuts( QKeySequence( QKeySequence::NextChild ), nextTabAction_->shortcut() ) );
|
||||
actionCollection_->setDefaultShortcut( contactsDockAction, QKeySequence( "Ctrl+D" ) );
|
||||
actionCollection_->setDefaultShortcut( standardEmoticonsDockAction, QKeySequence( "Ctrl+E" ) );
|
||||
actionCollection_->setDefaultShortcut( customEmoticonsDockAction, QKeySequence( "Ctrl+Y" ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1660,6 +1670,7 @@ void ChatWindow::sendMessage()
|
||||
// Don't send empty messages
|
||||
if( text.trimmed().isEmpty() )
|
||||
{
|
||||
doSendTypingMessages_ = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1682,6 +1693,8 @@ void ChatWindow::sendMessage()
|
||||
// Handle command. If 'false' is returned, send it anyway.
|
||||
if ( handleCommand( command ) )
|
||||
{
|
||||
doSendTypingMessages_ = true;
|
||||
slotMessageChanged();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1747,6 +1760,8 @@ void ChatWindow::sendMessage()
|
||||
quickRetypeList.append( message.getBody() );
|
||||
lastSentence_ = QString();
|
||||
|
||||
slotMessageChanged();
|
||||
|
||||
// Reset the last sentence counter.
|
||||
// showMessage() updates chatMessages_
|
||||
indexSentences_ = quickRetypeList.size();
|
||||
|
||||
@@ -421,7 +421,7 @@ ContactFrame* ContactsWidget::createContactFrame()
|
||||
this, SIGNAL( contactBlocked( QString, bool ) ) );
|
||||
|
||||
// Add it to the viewBox so it appears in the widget
|
||||
layout_->insertWidget( children().count() - 2, contactFrame );
|
||||
layout_->insertWidget( layout_->count(), contactFrame );
|
||||
|
||||
// put it in the list of frames so we can find it again.
|
||||
contactFrames_.append( contactFrame );
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <QCommandLineParser>
|
||||
#include <KIconLoader>
|
||||
#include <KWindowSystem>
|
||||
#include <kcoreaddons_version.h>
|
||||
|
||||
|
||||
@@ -84,6 +85,24 @@ KMessApplication::~KMessApplication()
|
||||
|
||||
|
||||
|
||||
void KMessApplication::activateRequested( const QStringList &arguments, const QString &workingDirectory )
|
||||
{
|
||||
Q_UNUSED( arguments );
|
||||
Q_UNUSED( workingDirectory );
|
||||
|
||||
if( contactListWindow_ == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
contactListWindow_->show();
|
||||
KWindowSystem::updateStartupId( contactListWindow_->windowHandle() );
|
||||
contactListWindow_->raise();
|
||||
KWindowSystem::activateWindow( contactListWindow_->windowHandle() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the contact list window
|
||||
*/
|
||||
|
||||
@@ -65,6 +65,9 @@ class KMessApplication : public QApplication
|
||||
void setQuitSelected(bool quitSelected);
|
||||
void initialize( const QCommandLineParser &parser );
|
||||
|
||||
public slots:
|
||||
void activateRequested( const QStringList &arguments, const QString &workingDirectory );
|
||||
|
||||
private slots:
|
||||
void slotAboutToQuit();
|
||||
void slotLastWindowClosed();
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "kmessdebug.h"
|
||||
|
||||
#include <KAboutData>
|
||||
#include <KDBusService>
|
||||
#include <KLocalizedString>
|
||||
|
||||
#include <QCommandLineOption>
|
||||
@@ -64,6 +65,7 @@ int main(int argc, char *argv[])
|
||||
"http://www.kmess.org/", // home page
|
||||
"bugs" "@" "kmess" "." "org" // address for bugs
|
||||
);
|
||||
aboutData.setOrganizationDomain( "kmess.org" );
|
||||
|
||||
// Note all email addresses are written in an anti-spam style.
|
||||
|
||||
@@ -243,6 +245,10 @@ int main(int argc, char *argv[])
|
||||
parser.process( kmessApp );
|
||||
aboutData.processCommandLine( &parser );
|
||||
|
||||
KDBusService dbusService( KDBusService::Unique );
|
||||
QObject::connect( &dbusService, &KDBusService::activateRequested,
|
||||
&kmessApp, &KMessApplication::activateRequested );
|
||||
|
||||
kmessApp.initialize( parser );
|
||||
|
||||
return kmessApp.exec();
|
||||
|
||||
@@ -2752,7 +2752,7 @@ void MsnNotificationConnection::removeContact(QString handle, bool block)
|
||||
|
||||
// Remove the contact from AB
|
||||
AddressBookService *addressBook = createAddressBookService();;
|
||||
addressBook->deleteContact( contactId );
|
||||
addressBook->deleteContact( contactId, handle );
|
||||
|
||||
// if not blocking, make sure we re-add to the Allow list.
|
||||
// ABContactDelete removes them from the Allow list for some reason. This was what
|
||||
|
||||
@@ -1733,7 +1733,7 @@ void MsnSwitchboardConnection::sendInk( InkFormat format, const QByteArray& ink
|
||||
bool capable = true;
|
||||
ContactBase *contact;
|
||||
|
||||
int inkCapabilityFlag;
|
||||
ContactBase::MsnClientCapabilities inkCapabilityFlag;
|
||||
switch( format )
|
||||
{
|
||||
case FORMAT_ISF:
|
||||
@@ -1742,6 +1742,9 @@ void MsnSwitchboardConnection::sendInk( InkFormat format, const QByteArray& ink
|
||||
case FORMAT_GIF:
|
||||
inkCapabilityFlag = ContactBase::MSN_CAP_INK_GIF;
|
||||
break;
|
||||
default:
|
||||
kmWarning() << "Refusing to send unsupported ink format:" << format;
|
||||
return;
|
||||
}
|
||||
|
||||
// Verify whether all contacts are capable to view this Ink message or not
|
||||
@@ -1750,14 +1753,14 @@ void MsnSwitchboardConnection::sendInk( InkFormat format, const QByteArray& ink
|
||||
{
|
||||
contact = currentAccount_->getContactByHandle( handle );
|
||||
if( ! contact->hasCapability( ContactBase::MSN_CAP_MULTI_PACKET )
|
||||
|| ! contact->hasCapability( (ContactBase::MsnClientCapabilities)inkCapabilityFlag ) )
|
||||
|| ! contact->hasCapability( inkCapabilityFlag ) )
|
||||
{
|
||||
unsupportingContact = contact;
|
||||
capable = false;
|
||||
#ifdef KMESSDEBUG_SWITCHBOARD_GENERAL
|
||||
kmDebug() << "Contact" << handle << "does not support our wink. "
|
||||
<< "Has multipacket?" << contact->hasCapability( ContactBase::MSN_CAP_MULTI_PACKET )
|
||||
<< "Has this ink type support?" << contact->hasCapability( (ContactBase::MsnClientCapabilities)inkCapabilityFlag );
|
||||
<< "Has this ink type support?" << contact->hasCapability( inkCapabilityFlag );
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ void AddressBookService::addContactToGroup( const QString &contactId, const QStr
|
||||
|
||||
MessageData data;
|
||||
data.type = "ContactAddToGroup";
|
||||
data.value = groupId;
|
||||
data.value = QStringList() << contactId << groupId;
|
||||
|
||||
sendSecureRequest( new SoapMessage( SERVICE_URL_ADDRESSBOOK,
|
||||
"http://www.msn.com/webservices/AddressBook/ABGroupContactAdd",
|
||||
@@ -299,7 +299,7 @@ void AddressBookService::contactUpdate( ContactProperty property, const QString
|
||||
|
||||
|
||||
|
||||
void AddressBookService::deleteContact( const QString &contactId )
|
||||
void AddressBookService::deleteContact( const QString &contactId, const QString &handle )
|
||||
{
|
||||
QString body( "<ABContactDelete xmlns=\"http://www.msn.com/webservices/AddressBook\">\n"
|
||||
" <abId>00000000-0000-0000-0000-000000000000</abId>\n"
|
||||
@@ -312,7 +312,7 @@ void AddressBookService::deleteContact( const QString &contactId )
|
||||
|
||||
MessageData data;
|
||||
data.type = "ContactDelete";
|
||||
data.value = contactId;
|
||||
data.value = QStringList() << contactId << handle;
|
||||
|
||||
sendSecureRequest( new SoapMessage( SERVICE_URL_ADDRESSBOOK,
|
||||
"http://www.msn.com/webservices/AddressBook/ABContactDelete",
|
||||
@@ -950,12 +950,18 @@ void AddressBookService::parseSecureResult( SoapMessage *message )
|
||||
emit contactAdded( handle, contactId, groupsId );
|
||||
emit addressBookChanged( handle, ContactAdded );
|
||||
}
|
||||
else if( ! handle.isEmpty() )
|
||||
{
|
||||
kmWarning() << "Contact add response did not include a contact id; refreshing address book.";
|
||||
retrieveAddressBook();
|
||||
}
|
||||
}
|
||||
else if( data.type == "ContactDelete" )
|
||||
{
|
||||
// A contact was deleted from the AB
|
||||
const QString contactId( data.value.toString() );
|
||||
const QString handle (data.value.toString() );
|
||||
const QStringList info ( data.value.toStringList() );
|
||||
const QString contactId( info.value( 0 ) );
|
||||
const QString handle ( info.value( 1 ) );
|
||||
|
||||
if( ! contactId.isEmpty() )
|
||||
{
|
||||
@@ -986,8 +992,14 @@ void AddressBookService::parseSecureResult( SoapMessage *message )
|
||||
{
|
||||
// A contact was added to a group
|
||||
|
||||
const QString groupId ( data.value.toString() );
|
||||
const QString contactId( body.elementsByTagName( "guid" ).item(0).toElement().text() );
|
||||
const QStringList info( data.value.toStringList() );
|
||||
QString contactId( body.elementsByTagName( "guid" ).item(0).toElement().text() );
|
||||
const QString groupId( info.value( 1 ) );
|
||||
|
||||
if( contactId.isEmpty() )
|
||||
{
|
||||
contactId = info.value( 0 );
|
||||
}
|
||||
|
||||
if( ! contactId.isEmpty() && ! groupId.isEmpty() )
|
||||
{
|
||||
@@ -1020,6 +1032,11 @@ void AddressBookService::parseSecureResult( SoapMessage *message )
|
||||
emit groupAdded( groupId, name );
|
||||
emit addressBookChanged( groupId, GroupAdded );
|
||||
}
|
||||
else if( ! name.isEmpty() )
|
||||
{
|
||||
kmWarning() << "Group add response did not include a group id; refreshing address book.";
|
||||
retrieveAddressBook();
|
||||
}
|
||||
}
|
||||
else if( data.type == "GroupDelete" )
|
||||
{
|
||||
@@ -1030,7 +1047,7 @@ void AddressBookService::parseSecureResult( SoapMessage *message )
|
||||
if( ! groupId.isEmpty() )
|
||||
{
|
||||
emit groupDeleted( groupId, name );
|
||||
emit addressBookChanged( name, GroupDeleted );
|
||||
emit addressBookChanged( groupId, GroupDeleted );
|
||||
}
|
||||
}
|
||||
else if( data.type == "GroupRename" )
|
||||
@@ -1043,7 +1060,7 @@ void AddressBookService::parseSecureResult( SoapMessage *message )
|
||||
if( ! groupId.isEmpty() && ! name.isEmpty() )
|
||||
{
|
||||
emit groupRenamed( groupId, name );
|
||||
emit addressBookChanged( name, GroupRenamed );
|
||||
emit addressBookChanged( groupId, GroupRenamed );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -73,7 +73,7 @@ class AddressBookService : public PassportLoginService
|
||||
// Put the Soap action to update the information about contact
|
||||
void contactUpdate( ContactProperty property, const QString &newValue );
|
||||
// Delete contact
|
||||
void deleteContact( const QString &contactId );
|
||||
void deleteContact( const QString &contactId, const QString &handle );
|
||||
// Delete contact from group
|
||||
void deleteContactFromGroup( const QString &contactId, const QString &groupId );
|
||||
// Delete group
|
||||
|
||||
Reference in New Issue
Block a user