Remove legacy code of Spoiler Messages impl

parent 519fc7ab
Pipeline #32142 canceled with stage
......@@ -49,7 +49,6 @@
constexpr auto MESSAGE_MAX_CHARS = 1e4;
// XML namespaces
#define NS_SPOILERS "urn:xmpp:spoiler:0"
#define NS_CARBONS "urn:xmpp:carbons:2"
// SQL
......
......@@ -194,26 +194,6 @@ void Message::setMediaSize(const qint64 &mediaSize)
m_mediaSize = mediaSize;
}
bool Message::isSpoiler() const
{
return m_isSpoiler;
}
void Message::setIsSpoiler(bool isSpoiler)
{
m_isSpoiler = isSpoiler;
}
QString Message::spoilerHint() const
{
return m_spoilerHint;
}
void Message::setSpoilerHint(const QString &spoilerHint)
{
m_spoilerHint = spoilerHint;
}
QString Message::errorText() const
{
return m_errorText;
......
......@@ -82,12 +82,6 @@ public:
qint64 mediaSize() const;
void setMediaSize(const qint64 &mediaSize);
bool isSpoiler() const;
void setIsSpoiler(bool isSpoiler);
QString spoilerHint() const;
void setSpoilerHint(const QString &spoilerHint);
QString errorText() const;
void setErrorText(const QString &errText);
......@@ -138,16 +132,6 @@ private:
*/
QDateTime m_mediaLastModified;
/**
* True if the message is a spoiler message.
*/
bool m_isSpoiler = false;
/**
* Hint of the spoiler message.
*/
QString m_spoilerHint;
/**
* Text description of an error if it ever happened to the message
*/
......
......@@ -171,15 +171,6 @@ void MessageHandler::sendMessage(const QString& toJid,
if (isSpoiler) {
msg.setIsSpoiler(isSpoiler);
msg.setSpoilerHint(spoilerHint);
// parsing/serialization of spoilers isn't implemented in QXmpp
QXmppElementList extensions = msg.extensions();
QXmppElement spoiler = QXmppElement();
spoiler.setTagName("spoiler");
spoiler.setValue(msg.spoilerHint());
spoiler.setAttribute("xmlns", NS_SPOILERS);
extensions.append(spoiler);
msg.setExtensions(extensions);
} else if (MediaUtils::isGeoLocation(msg.body())) {
const QUrl url(msg.body());
const QMimeType mimeType = MediaUtils::mimeType(url);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment