Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added psi-disable-messages-correct-behavior patch
- Loading branch information
Showing
3 changed files
with
144 additions
and
7 deletions.
There are no files selected for viewing
139 changes: 139 additions & 0 deletions
139
patches/0001-psi-disable-messages-correct-behavior.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
--- psi.orig/src/psiaccount.cpp | ||
+++ psi/src/psiaccount.cpp | ||
@@ -2648,10 +2648,7 @@ void PsiAccount::processIncomingMessage( | ||
} | ||
|
||
// change the type? | ||
- if (!EventDlg::messagingEnabled()) { | ||
- m.setType("chat"); | ||
- } | ||
- else if (m.type() != "headline" && m.invite().isEmpty() && m.mucInvites().isEmpty()) { | ||
+ if (m.type() != "headline" && m.invite().isEmpty() && m.mucInvites().isEmpty()) { | ||
const QString type = PsiOptions::instance()->getOption("options.messages.force-incoming-message-type").toString(); | ||
if (type == "message") | ||
m.setType(""); | ||
@@ -3543,7 +3540,7 @@ void PsiAccount::cpUpdate(const UserList | ||
EventDlg *PsiAccount::ensureEventDlg(const Jid &j) | ||
{ | ||
EventDlg *w = findDialog<EventDlg*>(j); | ||
- if (!w && EventDlg::messagingEnabled()) | ||
+ if (!w) | ||
w = new EventDlg(j, this, true); | ||
|
||
if (w) { | ||
@@ -3793,7 +3790,7 @@ void PsiAccount::actionRecvRosterExchang | ||
|
||
void PsiAccount::actionSendMessage(const Jid &j) | ||
{ | ||
- EventDlg *w = d->psi->createEventDlg(j.full(), this); | ||
+ EventDlg *w = d->psi->createMessageDlg(j.full(), this); | ||
if (!w) | ||
return; | ||
w->show(); | ||
@@ -3811,7 +3808,7 @@ void PsiAccount::actionSendMessage(const | ||
str += (*it).full(); | ||
} | ||
|
||
- EventDlg *w = d->psi->createEventDlg(str, this); | ||
+ EventDlg *w = d->psi->createMessageDlg(str, this); | ||
if (!w) | ||
return; | ||
w->show(); | ||
@@ -3819,7 +3816,7 @@ void PsiAccount::actionSendMessage(const | ||
|
||
void PsiAccount::actionSendUrl(const Jid &j) | ||
{ | ||
- EventDlg *w = d->psi->createEventDlg(j.full(), this); | ||
+ EventDlg *w = d->psi->createMessageDlg(j.full(), this); | ||
if (!w) | ||
return; | ||
w->setUrlOnShow(); | ||
@@ -4321,7 +4318,7 @@ void PsiAccount::dj_sendMessage(const Me | ||
|
||
void PsiAccount::dj_newMessage(const Jid &jid, const QString &body, const QString &subject, const QString &thread) | ||
{ | ||
- EventDlg *w = d->psi->createEventDlg(jid.full(), this); | ||
+ EventDlg *w = d->psi->createMessageDlg(jid.full(), this); | ||
if (!w) | ||
return; | ||
|
||
@@ -5002,8 +4999,6 @@ void PsiAccount::queueEvent(PsiEvent* e, | ||
else if (e->type() == PsiEvent::File) { | ||
doPopup = PsiOptions::instance()->getOption("options.ui.file-transfer.auto-popup").toBool(); | ||
} | ||
- else if (e->type() == PsiEvent::Auth && !EventDlg::messagingEnabled()) | ||
- doPopup = false; | ||
else { | ||
doPopup = PsiOptions::instance()->getOption("options.ui.message.auto-popup").toBool(); | ||
} | ||
--- psi.orig/src/psicon.cpp | ||
+++ psi/src/psicon.cpp | ||
@@ -886,20 +886,25 @@ void PsiCon::doNewBlankMessage() | ||
if(!account) | ||
return; | ||
|
||
- EventDlg *w = createEventDlg("", account); | ||
+ EventDlg *w = createMessageDlg("", account); | ||
if (!w) | ||
return; | ||
|
||
w->show(); | ||
} | ||
|
||
-// FIXME: smells fishy. Refactor! Probably create a common class for all dialogs and | ||
-// call optionsUpdate() automatically. | ||
-EventDlg *PsiCon::createEventDlg(const QString &to, PsiAccount *pa) | ||
+EventDlg *PsiCon::createMessageDlg(const QString &to, PsiAccount *pa) | ||
{ | ||
if (!EventDlg::messagingEnabled()) | ||
return 0; | ||
|
||
+ return createEventDlg(to, pa); | ||
+} | ||
+ | ||
+// FIXME: smells fishy. Refactor! Probably create a common class for all dialogs and | ||
+// call optionsUpdate() automatically. | ||
+EventDlg *PsiCon::createEventDlg(const QString &to, PsiAccount *pa) | ||
+{ | ||
EventDlg *w = new EventDlg(to, this, pa); | ||
connect(this, SIGNAL(emitOptionsUpdate()), w, SLOT(optionsUpdate())); | ||
return w; | ||
@@ -1609,27+1614,12 @@ void PsiCon::processEvent(PsiEvent *e, A | ||
const Message &m = me->message(); | ||
bool emptyForm = m.getForm().fields().empty(); | ||
// FIXME: Refactor this, PsiAccount and PsiEvent out | ||
- if ((m.type() == "chat" && emptyForm) | ||
- || !EventDlg::messagingEnabled()) { | ||
+ if (m.type() == "chat" && emptyForm) { | ||
isChat = true; | ||
sentToChatWindow = me->sentToChatWindow(); | ||
} | ||
} | ||
|
||
- if (e->type() == PsiEvent::Auth && !EventDlg::messagingEnabled()) { | ||
- if (static_cast<AuthEvent*>(e)->authType() == "subscribe") { | ||
-#ifdef YAPSI | ||
- bringToFront(d->mainwin); | ||
- return; | ||
-#else | ||
- e->account()->dj_addAuth(e->jid()); | ||
-#endif | ||
- } | ||
- e->account()->eventQueue()->dequeue(e); | ||
- delete e; | ||
- return; | ||
- } | ||
- | ||
if ( isChat ) { | ||
PsiAccount* account = e->account(); | ||
XMPP::Jid from = e->from(); | ||
--- psi.orig/src/psicon.h | ||
+++ psi/src/psicon.h | ||
@@ -111,6 +111,7 @@ public: | ||
const QStringList & recentNodeList() const; | ||
void recentNodeAdd(const QString &); | ||
|
||
+ EventDlg *createMessageDlg(const QString &, PsiAccount*); | ||
EventDlg *createEventDlg(const QString &, PsiAccount*); | ||
void updateContactGlobal(PsiAccount *, const Jid &); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d97fa2b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Патч меняет поведение опции options.message.enabled
В результате при включенной опции входящие сообщения и другие события отображаются в диалоге, события не "зависают". Исходящие сообщения запрещены и отключены в меню.
Заодно исправлен баг 560.