mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 22:56:42 +02:00
Ignore all but the lastest DM from a particular user
This commit is contained in:
@@ -259,7 +259,20 @@ TwitterPlugin::directMessages( const QList< QTweetDMStatus > &messages )
|
|||||||
|
|
||||||
bool peersChanged = false;
|
bool peersChanged = false;
|
||||||
|
|
||||||
|
QHash< QString, QTweetDMStatus > latestHash;
|
||||||
|
|
||||||
foreach ( QTweetDMStatus status, messages )
|
foreach ( QTweetDMStatus status, messages )
|
||||||
|
{
|
||||||
|
if ( !latestHash.contains( status.senderScreenName() ) )
|
||||||
|
latestHash[status.senderScreenName()] = status;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( status.id() > latestHash[status.senderScreenName()].id() )
|
||||||
|
latestHash[status.senderScreenName()] = status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach( QTweetDMStatus status, latestHash.values() )
|
||||||
{
|
{
|
||||||
qDebug() << "TwitterPlugin checking direct message from " << status.senderScreenName() << " with content " << status.text();
|
qDebug() << "TwitterPlugin checking direct message from " << status.senderScreenName() << " with content " << status.text();
|
||||||
if ( status.id() > m_cachedDirectMessagesSinceId )
|
if ( status.id() > m_cachedDirectMessagesSinceId )
|
||||||
|
Reference in New Issue
Block a user