@ -241,7 +241,8 @@ InputBar::updateTextContentProperties(const QString &t)
QStringLiteral ( " goto " ) ,
QStringLiteral ( " goto " ) ,
QStringLiteral ( " converttodm " ) ,
QStringLiteral ( " converttodm " ) ,
QStringLiteral ( " converttoroom " ) ,
QStringLiteral ( " converttoroom " ) ,
QStringLiteral ( " ignore " ) } ;
QStringLiteral ( " ignore " ) ,
QStringLiteral ( " unignore " ) } ;
bool hasInvalidCommand = ! commandName . isNull ( ) & & ! validCommands . contains ( commandName ) ;
bool hasInvalidCommand = ! commandName . isNull ( ) & & ! validCommands . contains ( commandName ) ;
bool hasIncompleteCommand = hasInvalidCommand & & ' / ' + commandName = = t ;
bool hasIncompleteCommand = hasInvalidCommand & & ' / ' + commandName = = t ;
@ -940,15 +941,9 @@ InputBar::command(const QString &command, QString args)
} else if ( command = = QLatin1String ( " converttoroom " ) ) {
} else if ( command = = QLatin1String ( " converttoroom " ) ) {
utils : : removeDirectFromRoom ( this - > room - > roomId ( ) ) ;
utils : : removeDirectFromRoom ( this - > room - > roomId ( ) ) ;
} else if ( command = = QLatin1String ( " ignore " ) ) {
} else if ( command = = QLatin1String ( " ignore " ) ) {
QSharedPointer < UserProfile > user (
this - > setArgIgnored ( args , true ) ;
new UserProfile ( QString ( ) , args , TimelineViewManager : : instance ( ) ) ) ;
} else if ( command = = QLatin1String ( " unignore " ) ) {
connect ( user . get ( ) , & UserProfile : : failedToFetchProfile , [ args ] {
this - > setArgIgnored ( args , false ) ;
MainWindow : : instance ( ) - > showNotification ( tr ( " Failed to fetch user %1 " ) . arg ( args ) ) ;
} ) ;
connect ( user . get ( ) , & UserProfile : : globalUsernameRetrieved , [ user ] ( const QString & user_id ) {
Q_UNUSED ( user_id )
user - > setIgnored ( true ) ;
} ) ;
} else {
} else {
return false ;
return false ;
}
}
@ -956,6 +951,23 @@ InputBar::command(const QString &command, QString args)
return true ;
return true ;
}
}
void
InputBar : : setArgIgnored ( const QString & user , const bool ignored )
{
QSharedPointer < UserProfile > profile (
new UserProfile ( QString ( ) , user , TimelineViewManager : : instance ( ) ) ) ;
connect ( profile . get ( ) , & UserProfile : : failedToFetchProfile , [ user ] {
MainWindow : : instance ( ) - > showNotification ( tr ( " Failed to fetch user %1 " ) . arg ( user ) ) ;
} ) ;
connect ( profile . get ( ) ,
& UserProfile : : globalUsernameRetrieved ,
[ profile , ignored ] ( const QString & user_id ) {
Q_UNUSED ( user_id )
profile - > setIgnored ( ignored ) ;
} ) ;
}
MediaUpload : : MediaUpload ( std : : unique_ptr < QIODevice > source_ ,
MediaUpload : : MediaUpload ( std : : unique_ptr < QIODevice > source_ ,
const QString & mimetype ,
const QString & mimetype ,
const QString & originalFilename ,
const QString & originalFilename ,