[Desktop] Change ThreadID to long

Summary: Change ThreadID to long

Test Plan:
Messages should send and receive as before. Additionally, if your device has assigned extremely large ThreadIDs, the SMS plugin should no longer crash.

This patch corresponds to the Android-side revision D17517

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17516
This commit is contained in:
Simon Redman 2018-12-11 18:03:17 -07:00
parent 5c468f0ecd
commit 5cdfb9b087
3 changed files with 8 additions and 8 deletions

View file

@ -32,7 +32,7 @@ ConversationMessage::ConversationMessage(const QVariantMap& args, QObject* paren
m_date(args["date"].toLongLong()), m_date(args["date"].toLongLong()),
m_type(args["type"].toInt()), m_type(args["type"].toInt()),
m_read(args["read"].toInt()), m_read(args["read"].toInt()),
m_threadID(args["thread_id"].toInt()), m_threadID(args["thread_id"].toLongLong()),
m_uID(args["_id"].toInt()) m_uID(args["_id"].toInt())
{ {
} }
@ -40,7 +40,7 @@ ConversationMessage::ConversationMessage(const QVariantMap& args, QObject* paren
ConversationMessage::ConversationMessage (const qint32& eventField, const QString& body, ConversationMessage::ConversationMessage (const qint32& eventField, const QString& body,
const QString& address, const qint64& date, const QString& address, const qint64& date,
const qint32& type, const qint32& read, const qint32& type, const qint32& read,
const qint32& threadID, const qint64& threadID,
const qint32& uID, const qint32& uID,
QObject* parent) QObject* parent)
: QObject(parent) : QObject(parent)
@ -120,7 +120,7 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, ConversationMessa
qint64 date; qint64 date;
qint32 type; qint32 type;
qint32 read; qint32 read;
qint32 threadID; qint64 threadID;
qint32 uID; qint32 uID;
argument.beginStructure(); argument.beginStructure();

View file

@ -38,7 +38,7 @@ class KDECONNECTINTERFACES_EXPORT ConversationMessage
Q_PROPERTY(qint64 date READ date) Q_PROPERTY(qint64 date READ date)
Q_PROPERTY(qint32 type READ type) Q_PROPERTY(qint32 type READ type)
Q_PROPERTY(qint32 read READ read) Q_PROPERTY(qint32 read READ read)
Q_PROPERTY(qint32 threadID READ threadID) Q_PROPERTY(qint64 threadID READ threadID)
Q_PROPERTY(qint32 uID READ uID) Q_PROPERTY(qint32 uID READ uID)
public: public:
@ -73,7 +73,7 @@ public:
ConversationMessage(const qint32& eventField, const QString& body, const QString& address, ConversationMessage(const qint32& eventField, const QString& body, const QString& address,
const qint64& date, const qint32& type, const qint32& read, const qint64& date, const qint32& type, const qint32& read,
const qint32& threadID, const qint32& uID, const qint64& threadID, const qint32& uID,
QObject* parent = Q_NULLPTR); QObject* parent = Q_NULLPTR);
ConversationMessage(const ConversationMessage& other, QObject* parent = Q_NULLPTR); ConversationMessage(const ConversationMessage& other, QObject* parent = Q_NULLPTR);
@ -87,7 +87,7 @@ public:
qint64 date() const { return m_date; } qint64 date() const { return m_date; }
qint32 type() const { return m_type; } qint32 type() const { return m_type; }
qint32 read() const { return m_read; } qint32 read() const { return m_read; }
qint32 threadID() const { return m_threadID; } qint64 threadID() const { return m_threadID; }
qint32 uID() const { return m_uID; } qint32 uID() const { return m_uID; }
QVariantMap toVariant() const; QVariantMap toVariant() const;
@ -129,7 +129,7 @@ protected:
/** /**
* Tag which binds individual messages into a thread * Tag which binds individual messages into a thread
*/ */
qint32 m_threadID; qint64 m_threadID;
/** /**
* Value which uniquely identifies a message * Value which uniquely identifies a message

View file

@ -78,7 +78,7 @@ void SmsPlugin::requestAllConversations()
void SmsPlugin::requestConversation (const QString& conversationID) const void SmsPlugin::requestConversation (const QString& conversationID) const
{ {
NetworkPacket np(PACKET_TYPE_SMS_REQUEST_CONVERSATION); NetworkPacket np(PACKET_TYPE_SMS_REQUEST_CONVERSATION);
np.set("threadID", conversationID.toInt()); np.set("threadID", conversationID.toLongLong());
sendPacket(np); sendPacket(np);
} }