fix for presences in MUCs, fix for memory limit in message history, fix for message line resizing, started working on messages

This commit is contained in:
Blue 2019-09-10 17:33:39 +03:00
parent 139c0de0e3
commit 0574d6f72b
15 changed files with 332 additions and 95 deletions

View file

@ -468,6 +468,7 @@ void Core::Account::logMessage(const QXmppMessage& msg, const QString& reason)
qDebug() << "- state: " << msg.state();
qDebug() << "- stamp: " << msg.stamp();
qDebug() << "- id: " << msg.id();
qDebug() << "- outOfBandUrl: " << msg.outOfBandUrl();
qDebug() << "- isAttentionRequested: " << msg.isAttentionRequested();
qDebug() << "- isReceiptRequested: " << msg.isReceiptRequested();
qDebug() << "- receiptId: " << msg.receiptId();
@ -607,6 +608,7 @@ void Core::Account::initializeMessage(Shared::Message& target, const QXmppMessag
target.setTo(source.to());
target.setBody(source.body());
target.setForwarded(forwarded);
target.setOutOfBandUrl(source.outOfBandUrl());
if (guessing) {
if (target.getFromJid() == getLogin() + "@" + getServer()) {
outgoing = true;
@ -624,7 +626,7 @@ void Core::Account::initializeMessage(Shared::Message& target, const QXmppMessag
void Core::Account::onMamMessageReceived(const QString& queryId, const QXmppMessage& msg)
{
if (msg.id().size() > 0 && msg.body().size() > 0) {
if (msg.id().size() > 0 && (msg.body().size() > 0 || msg.outOfBandUrl().size() > 0)) {
std::map<QString, QString>::const_iterator itr = achiveQueries.find(queryId);
QString jid = itr->second;
RosterItem* item = 0;

View file

@ -57,6 +57,7 @@ void Core::Archive::open(const QString& account)
}
mdb_env_set_maxdbs(environment, 4);
mdb_env_set_mapsize(environment, 1UL * 1024UL * 1024UL * 1024UL);
mdb_env_open(environment, path.toStdString().c_str(), 0, 0664);
MDB_txn *txn;

View file

@ -137,7 +137,7 @@ void Core::Conference::onRoomParticipantAdded(const QString& p_name)
if (resource == jid) {
qDebug() << "Room" << jid << "is reporting of adding itself to the list participants. Not sure what to do with that yet, skipping";
} else {
QXmppPresence pres = room->participantPresence(jid);
QXmppPresence pres = room->participantPresence(p_name);
QDateTime lastInteraction = pres.lastUserInteraction();
if (!lastInteraction.isValid()) {
lastInteraction = QDateTime::currentDateTime();
@ -161,7 +161,7 @@ void Core::Conference::onRoomParticipantChanged(const QString& p_name)
if (resource == jid) {
qDebug() << "Room" << jid << "is reporting of changing his own presence. Not sure what to do with that yet, skipping";
} else {
QXmppPresence pres = room->participantPresence(jid);
QXmppPresence pres = room->participantPresence(p_name);
QDateTime lastInteraction = pres.lastUserInteraction();
if (!lastInteraction.isValid()) {
lastInteraction = QDateTime::currentDateTime();

View file

@ -71,7 +71,7 @@ void Core::RosterItem::setName(const QString& n)
void Core::RosterItem::addMessageToArchive(const Shared::Message& msg)
{
if (msg.getId().size() > 0 && msg.getBody().size() > 0) {
if (msg.storable()) {
hisoryCache.push_back(msg);
}
}
@ -184,7 +184,7 @@ void Core::RosterItem::appendMessageToArchive(const Shared::Message& msg)
{
const QString& id = msg.getId();
if (id.size() > 0) {
if (msg.getBody().size() > 0) {
if (msg.storable()) {
switch (archiveState) {
case empty:
if (archive->addElement(msg)) {