Compare commits
4 Commits
6.0_alpha3
...
6.0_alpha4
| Author | SHA1 | Date | |
|---|---|---|---|
| bd03359d79 | |||
| 89b4218853 | |||
| f9f479588f | |||
| 40e81af6c6 |
+1
-1
@@ -55,7 +55,7 @@ else()
|
||||
set(KMESS_DISABLE_LIKEBACK 0)
|
||||
endif()
|
||||
|
||||
set(KMESS_VERSION "6.0_alpha3")
|
||||
set(KMESS_VERSION "6.0_alpha4")
|
||||
set(KMESS_ENABLE_DEBUG_OUTPUT 0)
|
||||
set(KMESS_BUILT_DEBUGFULL FALSE)
|
||||
set(HAVE_LIBISFQT 1)
|
||||
|
||||
@@ -352,7 +352,7 @@ QString ChatMessageStyle::createFallbackMessage(const ChatMessage &message)
|
||||
if( ! message.hasHtmlBody() )
|
||||
{
|
||||
// Escape HTML, replace all emoticons, links and formatting
|
||||
RichTextParser::parseMsnString( body, useEmoticons_, false, true, useFormatting_, allowEmoticonLinks_, handle, pendingEmoticonTags_ );
|
||||
RichTextParser::parseMsnString( body, useEmoticons_, false, true, useFormatting_, allowEmoticonLinks_, handle, &pendingEmoticonTags_ );
|
||||
|
||||
// Replace font special effects, like *bold*
|
||||
if( useFontEffects_ )
|
||||
@@ -489,7 +489,7 @@ QString ChatMessageStyle::convertMessageToXml( const ChatMessage &message, bool
|
||||
!isPresence,
|
||||
(isPresence ? false : useFormatting_),
|
||||
(isPresence ? false : allowEmoticonLinks_),
|
||||
(isPresence ? QString() : handle), pendingEmoticonTags_ );
|
||||
(isPresence ? QString() : handle), &pendingEmoticonTags_ );
|
||||
|
||||
if( useFontEffects_ )
|
||||
{
|
||||
|
||||
@@ -1436,6 +1436,15 @@ bool ChatWindow::queryExit()
|
||||
|
||||
|
||||
|
||||
// Restore the window properties (called by KMainWindow)
|
||||
void ChatWindow::readProperties()
|
||||
{
|
||||
const KConfigGroup config( KMessConfig::instance()->getAccountConfig( currentAccount_->getHandle(), "ChatWindow" ) );
|
||||
readProperties( config );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Restore the window properties (called by KMainWindow)
|
||||
void ChatWindow::readProperties(const KConfigGroup &config )
|
||||
{
|
||||
@@ -1501,6 +1510,15 @@ void ChatWindow::saveChat()
|
||||
|
||||
|
||||
|
||||
// Save the window properties (called by KMainWindow)
|
||||
void ChatWindow::saveProperties()
|
||||
{
|
||||
KConfigGroup config( KMessConfig::instance()->getAccountConfig( currentAccount_->getHandle(), "ChatWindow" ) );
|
||||
saveProperties( config );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Save the window properties (called by KMainWindow)
|
||||
void ChatWindow::saveProperties( KConfigGroup &config )
|
||||
{
|
||||
|
||||
@@ -109,9 +109,11 @@ class ChatWindow : public KXmlGuiWindow, private Ui::ChatWindow
|
||||
// Create the menus.
|
||||
void createMenus();
|
||||
// Restore the window properties (called by KMainWindow)
|
||||
void readProperties( const KConfigGroup &config = *((const KConfigGroup *)0) ) override;
|
||||
void readProperties();
|
||||
void readProperties( const KConfigGroup &config ) override;
|
||||
// Save the window properties (called by KMainWindow)
|
||||
void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) ) override;
|
||||
void saveProperties();
|
||||
void saveProperties( KConfigGroup &config ) override;
|
||||
// Enable or disable the parts of the window which allow user interaction
|
||||
void setEnabled( bool isEnabled );
|
||||
// Set the window icon for this chat window
|
||||
|
||||
+31
-1
@@ -1693,6 +1693,15 @@ void KMess::saveGlobalProperties( KConfig *sessionConfig )
|
||||
|
||||
|
||||
|
||||
// Read in account and other properties
|
||||
void KMess::readProperties()
|
||||
{
|
||||
KConfigGroup config( KMessConfig::instance()->getGlobalConfig( "MainWindow" ) );
|
||||
readProperties( config );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Read in account and other properties
|
||||
void KMess::readProperties( const KConfigGroup &config )
|
||||
{
|
||||
@@ -1705,6 +1714,15 @@ void KMess::readProperties( const KConfigGroup &config )
|
||||
|
||||
|
||||
|
||||
// Save account and other properties
|
||||
void KMess::saveProperties()
|
||||
{
|
||||
KConfigGroup config( KMessConfig::instance()->getGlobalConfig( "MainWindow" ) );
|
||||
saveProperties( config );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Save account and other properties
|
||||
void KMess::saveProperties( KConfigGroup &config )
|
||||
{
|
||||
@@ -1802,7 +1820,19 @@ void KMess::showUserProfile()
|
||||
}
|
||||
|
||||
const QString url( currentAccount_->getUrlInformation().value( "PROFILE" ) );
|
||||
KMessShared::openBrowser( QUrl::fromUserInput( url, QString(), QUrl::AssumeLocalFile ) );
|
||||
QUrl profileUrl;
|
||||
|
||||
if( url.isEmpty() )
|
||||
{
|
||||
kmWarning() << "No profile URL received from the server; opening the NINA account portal instead.";
|
||||
profileUrl = QUrl( "https://account.nina.chat/login/" );
|
||||
}
|
||||
else
|
||||
{
|
||||
profileUrl = QUrl::fromUserInput( url, QString(), QUrl::AssumeLocalFile );
|
||||
}
|
||||
|
||||
KMessShared::openBrowser( profileUrl );
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-2
@@ -89,11 +89,13 @@ class KMess : public KMessInterface
|
||||
// Load the application's global state
|
||||
void readGlobalProperties( KConfig *sessionConfig ) override;
|
||||
// Read in account and other properties
|
||||
void readProperties( const KConfigGroup &config = *((const KConfigGroup *)0) ) override;
|
||||
void readProperties();
|
||||
void readProperties( const KConfigGroup &config ) override;
|
||||
// Save the application's global state
|
||||
void saveGlobalProperties( KConfig *sessionConfig ) override;
|
||||
// Save account and other properties
|
||||
void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) ) override;
|
||||
void saveProperties();
|
||||
void saveProperties( KConfigGroup &config ) override;
|
||||
|
||||
private: // Private methods
|
||||
// The application is closing, after queryClose() was approved
|
||||
|
||||
@@ -72,9 +72,9 @@ class KMessInterface : public KXmlGuiWindow
|
||||
virtual bool initialize();
|
||||
|
||||
// Restore the window properties (called by KMainWindow)
|
||||
virtual void readProperties( const KConfigGroup &config = *((const KConfigGroup *)0) ) override;
|
||||
virtual void readProperties( const KConfigGroup &config ) override;
|
||||
// Save the window properties (called by KMainWindow)
|
||||
virtual void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) ) override;
|
||||
virtual void saveProperties( KConfigGroup &config ) override;
|
||||
|
||||
protected slots: // Protected slots
|
||||
// "Add a new contact" was selected from the menu.
|
||||
|
||||
+1
-1
@@ -774,7 +774,7 @@ void KMessTest::testMsnPlusInteractive()
|
||||
|
||||
// New parser
|
||||
text = input->document()->toPlainText();
|
||||
RichTextParser::parseMsnString( text, true, true, true, true, true, "contact1@kmess.org", pending );
|
||||
RichTextParser::parseMsnString( text, true, true, true, true, true, "contact1@kmess.org", &pending );
|
||||
cleaned = parsed = text;
|
||||
|
||||
RichTextParser::getCleanString( cleaned );
|
||||
|
||||
@@ -498,7 +498,7 @@ void MsnNotificationConnection::changePersonalProperties( const QString& cid, in
|
||||
{
|
||||
// Send BLP command for privacy settings, please refer to:
|
||||
// http://msnpiki.msnfanatic.com/index.php/Command:BLP
|
||||
const QString blpToSend( ( blp == 0 ) ? "BL" : "AL" );
|
||||
const QString blpToSend( ( blp == 2 ) ? "BL" : "AL" );
|
||||
sendCommand( "BLP", blpToSend );
|
||||
|
||||
if( legacyMsnAuthentication_ )
|
||||
|
||||
@@ -335,7 +335,6 @@ void HttpSoapConnection::sendNextRequest()
|
||||
request.setHeader ( QNetworkRequest::ContentLengthHeader, contents.size() );
|
||||
request.setRawHeader( "Accept", "*/*" );
|
||||
request.setRawHeader( "User-Agent", "KMess/" KMESS_VERSION );
|
||||
request.setRawHeader( "Connection", "Keep-Alive" );
|
||||
request.setRawHeader( "Cache-Control", "no-cache" );
|
||||
|
||||
#ifdef KMESSTEST
|
||||
@@ -459,6 +458,24 @@ void HttpSoapConnection::slotRequestFinished( QNetworkReply *reply )
|
||||
const QString error ( reply->attribute( QNetworkRequest::HttpReasonPhraseAttribute ).toString() );
|
||||
QUrl redirectUrl = reply->attribute( QNetworkRequest::RedirectionTargetAttribute ).toUrl();
|
||||
|
||||
if( statusCode == 404
|
||||
&& currentRequest_->getEndPoint().contains( "storageservice/SchematizedStore.asmx", Qt::CaseInsensitive )
|
||||
&& currentRequest_->getAction().endsWith( "/GetProfile" )
|
||||
&& replyContents.isEmpty() )
|
||||
{
|
||||
kmWarning() << "Storage profile not available on the server; continuing without roaming profile data.";
|
||||
|
||||
reply->abort();
|
||||
reply->deleteLater();
|
||||
|
||||
delete currentRequest_;
|
||||
currentRequest_ = 0;
|
||||
isSending_ = false;
|
||||
|
||||
QTimer::singleShot( 250, this, SLOT(sendNextRequest()) );
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef KMESSDEBUG_HTTPSOAPCONNECTION_GENERAL
|
||||
bool requestSuccess = false;
|
||||
const QUrl replyUrl( reply->url() );
|
||||
@@ -582,6 +599,7 @@ void HttpSoapConnection::slotRequestFinished( QNetworkReply *reply )
|
||||
kmWarning() << "Request endpoint:" << currentRequest_->getEndPoint()
|
||||
<< "SOAPAction:" << currentRequest_->getAction()
|
||||
<< "request-size:" << currentRequest_->getMessage().size()
|
||||
<< "reply-url:" << reply->url()
|
||||
<< "redirect:" << redirectUrl
|
||||
<< "content-type:" << reply->header( QNetworkRequest::ContentTypeHeader ).toString();
|
||||
kmWarning() << "Reply contents:";
|
||||
|
||||
@@ -828,6 +828,10 @@ void PassportLoginService::sendSecureRequest( SoapMessage *message, const QStrin
|
||||
kmDebug() << "Token is valid, adding it to the request.";
|
||||
#endif
|
||||
|
||||
const QString requestTokenValue( requiredTokenName == "Storage" && tokenValue.startsWith( "t=" )
|
||||
? tokenValue.left( 22 )
|
||||
: tokenValue );
|
||||
|
||||
// Insert the token value within the SOAP message header
|
||||
QDomNodeList list;
|
||||
QDomElement header( message->getHeader().toElement() );
|
||||
@@ -863,11 +867,11 @@ void PassportLoginService::sendSecureRequest( SoapMessage *message, const QStrin
|
||||
// If there is a child text node, simply replace its text
|
||||
if( item.firstChild().nodeType() == QDomNode::TextNode )
|
||||
{
|
||||
item.firstChild().toText().setNodeValue( tokenValue );
|
||||
item.firstChild().toText().setNodeValue( requestTokenValue );
|
||||
}
|
||||
else
|
||||
{
|
||||
QDomText text( item.ownerDocument().createTextNode( tokenValue ) );
|
||||
QDomText text( item.ownerDocument().createTextNode( requestTokenValue ) );
|
||||
item.appendChild( text );
|
||||
}
|
||||
break;
|
||||
@@ -879,7 +883,7 @@ void PassportLoginService::sendSecureRequest( SoapMessage *message, const QStrin
|
||||
#ifdef KMESSDEBUG_PASSPORTLOGINSERVICE
|
||||
kmDebug() << "Ticket tag found!";
|
||||
#endif
|
||||
item.setAttribute( "passport", tokenValue );
|
||||
item.setAttribute( "passport", requestTokenValue );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
/**
|
||||
* @brief URL of the Storage Service
|
||||
*/
|
||||
#define SERVICE_URL_STORAGE_SERVICE "https://m1.escargot.log1p.xyz/storageservice/SchematizedStore.asmx"
|
||||
#define SERVICE_URL_STORAGE_SERVICE "https://ds.escargot.nina.chat/storageservice/SchematizedStore.asmx"
|
||||
|
||||
static QDateTime parseServerIsoDate( const QString &value )
|
||||
{
|
||||
|
||||
@@ -785,6 +785,12 @@ QString KMessShared::htmlUnescape( const QString &string )
|
||||
*/
|
||||
void KMessShared::openBrowser( const QUrl &url )
|
||||
{
|
||||
if( url.isEmpty() || ! url.isValid() )
|
||||
{
|
||||
kmWarning() << "Refusing to open invalid URL:" << url;
|
||||
return;
|
||||
}
|
||||
|
||||
// Open the options
|
||||
KConfigGroup group = KMessConfig::instance()->getGlobalConfig( "General" );
|
||||
|
||||
@@ -842,7 +848,10 @@ void KMessShared::openBrowser( const QUrl &url )
|
||||
#ifdef KMESSDEBUG_SHARED_OPENEXTERNAL
|
||||
kmDebug() << "KDE default browser selected.";
|
||||
#endif
|
||||
QDesktopServices::openUrl( url );
|
||||
if( ! QDesktopServices::openUrl( url ) )
|
||||
{
|
||||
kmWarning() << "Unable to open URL with the desktop services:" << url;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -496,10 +496,10 @@ void RichTextParser::parseMsnPlusString( QString &text )
|
||||
* @param showFormatting Whether to show or strip away MSN+ formatting tags
|
||||
* @param allowEmoticonLinks If false, the parser will never add links for adding an emoticon (such as for the chat history dialog)
|
||||
* @param handle If not null or empty, custom emoticons of this contact will be parsed
|
||||
* @param pendingEmoticonTags If the handle is specified, this must be too: this is a list of pending
|
||||
* @param pendingEmoticonTags If the handle is specified, this can be set too: this is a list of pending
|
||||
* custom emoticons which the contact specified by <code>handle</code> has sent to us.
|
||||
*/
|
||||
void RichTextParser::parseMsnString( QString &text, bool showEmoticons, bool showSmallEmoticons, bool showLinks, bool showFormatting, bool allowEmoticonLinks, const QString &handle, QStringList &pendingEmoticonTags )
|
||||
void RichTextParser::parseMsnString( QString &text, bool showEmoticons, bool showSmallEmoticons, bool showLinks, bool showFormatting, bool allowEmoticonLinks, const QString &handle, QStringList *pendingEmoticonTags )
|
||||
{
|
||||
// Remove all HTML
|
||||
KMessShared::htmlEscape( text );
|
||||
@@ -833,7 +833,10 @@ void RichTextParser::parseMsnString( QString &text, bool showEmoticons, bool sho
|
||||
}
|
||||
|
||||
placeholderId = "ce" + QString::number( ++lastPendingEmoticonId_ );
|
||||
pendingEmoticonTags.append( placeholderId );
|
||||
if( pendingEmoticonTags != nullptr )
|
||||
{
|
||||
pendingEmoticonTags->append( placeholderId );
|
||||
}
|
||||
|
||||
// Insert placeholder
|
||||
matched = regexp->cap( 0 );
|
||||
|
||||
@@ -81,7 +81,7 @@ class RichTextParser
|
||||
// Initialize the class
|
||||
static void initialize();
|
||||
// Return the given string with links and emoticons translated to HTML
|
||||
static void parseMsnString( QString &text, bool showEmoticons = true, bool showSmallEmoticons = true, bool showLinks = true, bool showFormatting = false, bool allowEmoticonLinks = true, const QString &handle = *((QString*)0), QStringList &pendingEmoticonTags = *((QStringList*)0) );
|
||||
static void parseMsnString( QString &text, bool showEmoticons = true, bool showSmallEmoticons = true, bool showLinks = true, bool showFormatting = false, bool allowEmoticonLinks = true, const QString &handle = QString(), QStringList *pendingEmoticonTags = nullptr );
|
||||
|
||||
|
||||
private: // Private static methods
|
||||
|
||||
Reference in New Issue
Block a user