forked from blue/squawk
initial attempt to paint buttons in the messagefeed
This commit is contained in:
parent
ff4124d1f0
commit
00ffbac6b0
8 changed files with 156 additions and 18 deletions
|
@ -36,7 +36,8 @@ Shared::Message::Message(Shared::Message::Type p_type):
|
|||
errorText(),
|
||||
originalMessage(),
|
||||
lastModified(),
|
||||
stanzaId()
|
||||
stanzaId(),
|
||||
attachPath()
|
||||
{}
|
||||
|
||||
Shared::Message::Message():
|
||||
|
@ -56,7 +57,8 @@ Shared::Message::Message():
|
|||
errorText(),
|
||||
originalMessage(),
|
||||
lastModified(),
|
||||
stanzaId()
|
||||
stanzaId(),
|
||||
attachPath()
|
||||
{}
|
||||
|
||||
QString Shared::Message::getBody() const
|
||||
|
@ -311,6 +313,7 @@ void Shared::Message::serialize(QDataStream& data) const
|
|||
data << lastModified;
|
||||
}
|
||||
data << stanzaId;
|
||||
data << attachPath;
|
||||
}
|
||||
|
||||
void Shared::Message::deserialize(QDataStream& data)
|
||||
|
@ -341,6 +344,7 @@ void Shared::Message::deserialize(QDataStream& data)
|
|||
data >> lastModified;
|
||||
}
|
||||
data >> stanzaId;
|
||||
data >> attachPath;
|
||||
}
|
||||
|
||||
bool Shared::Message::change(const QMap<QString, QVariant>& data)
|
||||
|
@ -350,6 +354,16 @@ bool Shared::Message::change(const QMap<QString, QVariant>& data)
|
|||
setState(static_cast<State>(itr.value().toUInt()));
|
||||
}
|
||||
|
||||
itr = data.find("outOfBandUrl");
|
||||
if (itr != data.end()) {
|
||||
setOutOfBandUrl(itr.value().toString());
|
||||
}
|
||||
|
||||
itr = data.find("attachPath");
|
||||
if (itr != data.end()) {
|
||||
setAttachPath(itr.value().toString());
|
||||
}
|
||||
|
||||
if (state == State::error) {
|
||||
itr = data.find("errorText");
|
||||
if (itr != data.end()) {
|
||||
|
@ -432,3 +446,13 @@ QString Shared::Message::getStanzaId() const
|
|||
{
|
||||
return stanzaId;
|
||||
}
|
||||
|
||||
QString Shared::Message::getAttachPath() const
|
||||
{
|
||||
return attachPath;
|
||||
}
|
||||
|
||||
void Shared::Message::setAttachPath(const QString& path)
|
||||
{
|
||||
attachPath = path;
|
||||
}
|
||||
|
|
|
@ -16,15 +16,15 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SHAPER_MESSAGE_H
|
||||
#define SHAPER_MESSAGE_H
|
||||
|
||||
#include <QString>
|
||||
#include <QDateTime>
|
||||
#include <QVariant>
|
||||
#include <QMap>
|
||||
#include <QDataStream>
|
||||
|
||||
#ifndef SHAPER_MESSAGE_H
|
||||
#define SHAPER_MESSAGE_H
|
||||
|
||||
namespace Shared {
|
||||
|
||||
/**
|
||||
|
@ -72,6 +72,7 @@ public:
|
|||
void setErrorText(const QString& err);
|
||||
bool change(const QMap<QString, QVariant>& data);
|
||||
void setStanzaId(const QString& sid);
|
||||
void setAttachPath(const QString& path);
|
||||
|
||||
QString getFrom() const;
|
||||
QString getFromJid() const;
|
||||
|
@ -100,6 +101,7 @@ public:
|
|||
QDateTime getLastModified() const;
|
||||
QString getOriginalBody() const;
|
||||
QString getStanzaId() const;
|
||||
QString getAttachPath() const;
|
||||
|
||||
void serialize(QDataStream& data) const;
|
||||
void deserialize(QDataStream& data);
|
||||
|
@ -123,6 +125,7 @@ private:
|
|||
QString originalMessage;
|
||||
QDateTime lastModified;
|
||||
QString stanzaId;
|
||||
QString attachPath;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue