Hi!
Here comes the fix for the bugs Jon told about:
- Selecting "View Event" from the per-user menu brings up a new view
- Using a keyboard shortcut to view the event brings up a new view
--
Tuomas Jaakola
Index: mainwin.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/mainwin.cpp,v
retrieving revision 1.246
diff -u -r1.246 mainwin.cpp
--- mainwin.cpp 16 Oct 2002 06:10:28 -0000 1.246
+++ mainwin.cpp 17 Oct 2002 13:31:26 -0000
@@ -1631,20 +1631,7 @@
//userView->SelectedItemUin();
if (nUin == 0) return;
ICQUser *u = gUserManager.FetchUser(nUin, LOCK_R);
- // set default function to read or send depending on whether or not
- // there are new messages
int fcn = (u->NewMessages() == 0 ? mnuUserSendMsg : mnuUserView);
- if (fcn == mnuUserView && m_bMsgChatView)
- {
- // if one of the new events is a msg in chatview mode,
- // change def function to send
- for (unsigned short i = 0; i < u->NewMessages(); i++)
- if (u->EventPeek(i)->SubCommand() == ICQ_CMDxSUB_MSG)
- {
- fcn = mnuUserSendMsg;
- break;
- }
- }
gUserManager.DropUser(u);
// See if the clipboard contains a url
@@ -1751,26 +1738,7 @@
}
FOR_EACH_USER_END
- if (nUin != 0)
- {
- if (m_bMsgChatView)
- {
- ICQUser *u = gUserManager.FetchUser(nUin, LOCK_R);
- for (unsigned short i = 0; i < u->NewMessages(); i++)
- {
- if (u->EventPeek(i)->SubCommand() == ICQ_CMDxSUB_MSG)
- {
- gUserManager.DropUser(u);
- callFunction(mnuUserSendMsg, nUin);
- return;
- }
- }
-
- gUserManager.DropUser(u);
- }
- else
- callFunction(mnuUserView, nUin);
- }
+ callFunction(mnuUserView, nUin);
}
//-----CMainWindow::callUserFunction-------------------------------------------
@@ -1934,7 +1902,18 @@
UserEventCommon *CMainWindow::callFunction(int fcn, unsigned long nUin)
{
if (nUin == 0) return NULL;
-
+ if (fcn == mnuUserView && m_bMsgChatView)
+ {
+ ICQUser *u = gUserManager.FetchUser(nUin, LOCK_R);
+ fcn = mnuUserSendMsg;
+ for (unsigned short i = 0; i < u->NewMessages(); i++)
+ if (u->EventPeek(i)->SubCommand() != ICQ_CMDxSUB_MSG)
+ {
+ fcn = mnuUserView;
+ break;
+ }
+ gUserManager.DropUser(u);
+ }
UserEventCommon *e = NULL;
switch (fcn)