mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-02-26 04:43:06 +01:00
Most twitter handling should be working now. ish.
This commit is contained in:
commit
ecf436534a
@ -327,12 +327,13 @@ DNSResolver::DNSResolver()
|
||||
m_dnsShared->addInterface(QHostAddress::Any);
|
||||
m_dnsShared->addInterface(QHostAddress::AnyIPv6);
|
||||
m_dnsSharedRequest = new JDnsSharedRequest(m_dnsShared);
|
||||
|
||||
connect(m_dnsSharedRequest, SIGNAL(resultsReady()), SLOT(resultsReady()));
|
||||
}
|
||||
|
||||
void
|
||||
DNSResolver::resolve( QString &host, QString type )
|
||||
{
|
||||
connect(m_dnsSharedRequest, SIGNAL(resultsReady()), SLOT(resultsReady()));
|
||||
if( type == "SRV" )
|
||||
{
|
||||
// For the moment, assume we are looking for XMPP...
|
||||
|
@ -111,10 +111,12 @@ TwitterPlugin::connectAuthVerifyReply( const QTweetUser &user )
|
||||
m_mentions = QWeakPointer<QTweetMentions>( new QTweetMentions( m_twitterAuth.data(), this ) );
|
||||
m_directMessages = QWeakPointer<QTweetDirectMessages>( new QTweetDirectMessages( m_twitterAuth.data(), this ) );
|
||||
m_directMessageNew = QWeakPointer<QTweetDirectMessageNew>( new QTweetDirectMessageNew( m_twitterAuth.data(), this ) );
|
||||
m_directMessageDestroy = QWeakPointer<QTweetDirectMessageDestroy>( new QTweetDirectMessageDestroy( m_twitterAuth.data(), this ) );
|
||||
connect( m_friendsTimeline.data(), SIGNAL( parsedStatuses(const QList< QTweetStatus > &) ), SLOT( friendsTimelineStatuses(const QList<QTweetStatus> &) ) );
|
||||
connect( m_mentions.data(), SIGNAL( parsedStatuses(const QList< QTweetStatus > &) ), SLOT( mentionsStatuses(const QList<QTweetStatus> &) ) );
|
||||
connect( m_directMessages.data(), SIGNAL( parsedStatuses(const QList< QTweetDMStatus > &) ), SLOT( directMessages(const QList<QTweetDMStatus> &) ) );
|
||||
connect( m_directMessageNew.data(), SIGNAL( parsedStatuses(const QList< QTweetDMStatus > &) ), SLOT( directMessageNew(const QList<QTweetDMStatus> &) ) );
|
||||
connect( m_directMessageNew.data(), SIGNAL( parsedStatuses(const QList< QTweetDMStatus > &) ), SLOT( directMessagePosted(const QTweetDMStatus &) ) );
|
||||
connect( m_directMessageDestroy.data(), SIGNAL( parsedStatuses(const QList< QTweetDMStatus > &) ), SLOT( directMessageDestoyed(const QTweetDMStatus &) ) );
|
||||
QMetaObject::invokeMethod( this, "checkTimerFired", Qt::AutoConnection );
|
||||
}
|
||||
else
|
||||
@ -268,6 +270,8 @@ TwitterPlugin::directMessages( const QList< QTweetDMStatus > &messages )
|
||||
peersChanged = true;
|
||||
|
||||
QMetaObject::invokeMethod( this, "registerOffer", Q_ARG( QString, status.senderScreenName() ), QGenericArgument( "QHash< QString, QVariant >", (const void*)&peerData ) );
|
||||
if ( !m_directMessageDestroy.isNull() )
|
||||
m_directMessageDestroy.data()->destroyMessage( status.id() );
|
||||
}
|
||||
|
||||
TomahawkSettings::instance()->setTwitterCachedDirectMessagesSinceId( m_cachedDirectMessagesSinceId );
|
||||
@ -321,11 +325,17 @@ TwitterPlugin::sendOffer( const QString &screenName, const QHash< QString, QVari
|
||||
}
|
||||
|
||||
void
|
||||
TwitterPlugin::directMessageNew(const QTweetDMStatus& message)
|
||||
TwitterPlugin::directMessagePosted(const QTweetDMStatus& message)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
qDebug() << "Message sent to " << message.recipientScreenName() << " containing: " << message.text();
|
||||
qDebug() << "Message sent to " << message.recipientScreenName() << " containing: " << message.text();}
|
||||
|
||||
|
||||
void
|
||||
TwitterPlugin::directMessageDestroyed(const QTweetDMStatus& message)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
qDebug() << "Message " << message.text() << " destroyed";
|
||||
}
|
||||
|
||||
|
||||
Q_EXPORT_PLUGIN2( sip, TwitterPlugin )
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <qtweetfriendstimeline.h>
|
||||
#include <qtweetdirectmessages.h>
|
||||
#include <qtweetdirectmessagenew.h>
|
||||
#include <qtweetdirectmessagedestroy.h>
|
||||
#include <qtweetmentions.h>
|
||||
#include <qtweetdmstatus.h>
|
||||
|
||||
@ -55,7 +56,8 @@ private slots:
|
||||
void mentionsStatuses( const QList< QTweetStatus > &statuses );
|
||||
void pollDirectMessages();
|
||||
void directMessages( const QList< QTweetDMStatus > &messages );
|
||||
void directMessageNew( const QTweetDMStatus &message );
|
||||
void directMessagePosted( const QTweetDMStatus &message );
|
||||
void directMessageDestroyed( const QTweetDMStatus &message );
|
||||
void registerOffer( const QString &screenName, const QHash< QString, QVariant > &peerdata );
|
||||
void sendOffer( const QString &screenName, const QHash< QString, QVariant > &peerdata );
|
||||
void makeConnection( const QString &screenName, const QHash< QString, QVariant > &peerdata );
|
||||
@ -66,6 +68,7 @@ private:
|
||||
QWeakPointer< QTweetMentions > m_mentions;
|
||||
QWeakPointer< QTweetDirectMessages > m_directMessages;
|
||||
QWeakPointer< QTweetDirectMessageNew > m_directMessageNew;
|
||||
QWeakPointer< QTweetDirectMessageDestroy > m_directMessageDestroy;
|
||||
bool m_isAuthed;
|
||||
QTimer m_checkTimer;
|
||||
qint64 m_cachedFriendsSinceId;
|
||||
|
Loading…
x
Reference in New Issue
Block a user