This patch adds a new reply button to the view event window, as i've
requested a few days ago. It opens a chatmode view window, without
setting `Chatmode Messageview' in options dialog.  It opens chatmode
view on per user basis, so you can decide what you want. If you have set
`Chatmode ...' in the options, it leaves everything as you have
requested.

Regards.

TWISTI

PS: both patches also available on http://sector17.tvand.net/licq


diff -urN licq.orig/include/licq_user.h licq/include/licq_user.h
--- licq.orig/include/licq_user.h       Sat Jul 27 15:21:33 2002
+++ licq/include/licq_user.h    Sun Aug 18 15:28:50 2002
@@ -372,6 +372,9 @@
   void SetIgnoreList(bool s)     { SetInGroup(GROUPS_SYSTEM, GROUP_IGNORE_LIST, s); }
   void SetNewUser(bool s)        { SetInGroup(GROUPS_SYSTEM, GROUP_NEW_USERS, s); }
 
+  void SetChatmodeView(bool s) { m_bChatmodeView = s; }
+  bool GetChatmodeView()       { return m_bChatmodeView; }
+
   // Time
   time_t LocalTime();
   int LocalTimeGMTOffset();
@@ -473,7 +476,8 @@
        m_bShowAwayMsg,
        m_bOfflineOnDisconnect,
        m_bConnectionInProgress,
-       m_bSecure;
+       m_bSecure,
+       m_bChatmodeView;
   unsigned short m_nStatusToUser, m_nSendLevel;
   unsigned short m_nAutoAccept;
 
diff -urN licq.orig/plugins/qt-gui/src/usereventdlg.cpp 
licq/plugins/qt-gui/src/usereventdlg.cpp
--- licq.orig/plugins/qt-gui/src/usereventdlg.cpp       Mon Aug 12 09:32:26 2002
+++ licq/plugins/qt-gui/src/usereventdlg.cpp    Sun Aug 18 15:33:28 2002
@@ -349,20 +349,23 @@
   lay->addSpacing(10);
   lay->addWidget(h_action);
   btnRead1 = new CEButton(h_action);
+  btnReadChatmodeView = new QPushButton(h_action);
   btnRead2 = new QPushButton(h_action);
   btnRead3 = new QPushButton(h_action);
   btnRead4 = new QPushButton(h_action);
-
+  
   btnRead1->setEnabled(false);
+  btnReadChatmodeView->setEnabled(false);
   btnRead2->setEnabled(false);
   btnRead3->setEnabled(false);
   btnRead4->setEnabled(false);
-
+  
   connect(btnRead1, SIGNAL(clicked()), this, SLOT(slot_btnRead1()));
+  connect(btnReadChatmodeView, SIGNAL(clicked()), this, 
+SLOT(slot_btnReadChatmodeView()));
   connect(btnRead2, SIGNAL(clicked()), this, SLOT(slot_btnRead2()));
   connect(btnRead3, SIGNAL(clicked()), this, SLOT(slot_btnRead3()));
   connect(btnRead4, SIGNAL(clicked()), this, SLOT(slot_btnRead4()));
-
+  
   QBoxLayout *h_lay = new QHBoxLayout(top_lay, 4);
   if (!m_bOwner)
   {
@@ -439,8 +442,9 @@
   bool doclose = (u->NewMessages() == 0);
   gUserManager.DropUser(u);
 
-  if(doclose)
+  if(doclose) {
     close();
+  }
 }
 
 //-----UserViewEvent::updateNextButton---------------------------------------
@@ -481,10 +485,12 @@
   MsgViewItem *e = (MsgViewItem *)eq;
 
   btnRead1->setText("");
+  btnReadChatmodeView->setText("");
   btnRead2->setText("");
   btnRead3->setText("");
   btnRead4->setText("");
   btnRead1->setEnabled(false);
+  btnReadChatmodeView->setEnabled(false);
   btnRead2->setEnabled(false);
   btnRead3->setEnabled(false);
   btnRead4->setEnabled(false);
@@ -531,6 +537,7 @@
 
       case ICQ_CMDxSUB_MSG:
         btnRead1->setText(tr("&Reply"));
+       btnReadChatmodeView->setText(tr("Chatmode"));
         btnRead2->setText(tr("&Quote"));
         btnRead3->setText(tr("&Forward"));
         btnRead4->setText(tr("Start Chat"));
@@ -542,6 +549,7 @@
 
       case ICQ_CMDxSUB_URL:   // view a url
         btnRead1->setText(tr("&Reply"));
+       btnReadChatmodeView->setText(tr("Chatmode"));
         btnRead2->setText(tr("&Quote"));
         btnRead3->setText(tr("&Forward"));
         if (server->getUrlViewer() != NULL)
@@ -590,6 +598,7 @@
   }  // if
 
   if (!btnRead1->text().isEmpty()) btnRead1->setEnabled(true);
+  if (!btnReadChatmodeView->text().isEmpty()) btnReadChatmodeView->setEnabled(true);
   if (!btnRead2->text().isEmpty()) btnRead2->setEnabled(true);
   if (!btnRead3->text().isEmpty()) btnRead3->setEnabled(true);
   if (!btnRead4->text().isEmpty()) btnRead4->setEnabled(true);
@@ -633,7 +642,7 @@
 {
   UserSendMsgEvent *e = new UserSendMsgEvent(server, sigman, mainwin, m_nUin);
   e->setText(txt);
-
+  
   // Find a good position for the new window
   if (mainwin->m_bAutoPosReplyWin)
   {
@@ -671,8 +680,14 @@
     case ICQ_CMDxSUB_URL:
     case ICQ_CMDxSUB_CHAT:
     case ICQ_CMDxSUB_FILE:
-      sendMsg("");
-      break;
+      {
+       ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W);
+       u->SetChatmodeView(false);
+       gUserManager.DropUser(u);
+       
+       sendMsg("");
+       break;
+      }
 
     case ICQ_CMDxSUB_AUTHxREQUEST:
       (void) new AuthUserDlg(server, ((CEventAuthRequest 
*)m_xCurrentReadEvent)->Uin(), true);
@@ -709,8 +724,14 @@
   {
     case ICQ_CMDxSUB_MSG:  // quote
     case ICQ_CMDxSUB_URL:
-      generateReply();
-      break;
+      {
+       ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W);
+       u->SetChatmodeView(false);
+       gUserManager.DropUser(u);
+       
+       generateReply();
+       break;
+      }
 
     case ICQ_CMDxSUB_CHAT:  // accept a chat request
     {
@@ -763,6 +784,10 @@
     case ICQ_CMDxSUB_MSG:  // Forward
     case ICQ_CMDxSUB_URL:
     {
+      ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W);
+      u->SetChatmodeView(false);
+      gUserManager.DropUser(u);
+      
       CForwardDlg *f = new CForwardDlg(sigman, m_xCurrentReadEvent, this);
       f->show();
       break;
@@ -815,8 +840,15 @@
   switch (m_xCurrentReadEvent->SubCommand())
   {
     case ICQ_CMDxSUB_MSG:
-      mainwin->callFunction(mnuUserSendChat, Uin());
-      break;
+      {
+       ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W);
+       u->SetChatmodeView(false);
+       gUserManager.DropUser(u);
+       
+       mainwin->callFunction(mnuUserSendChat, Uin());
+       break;
+      }
+      
     case ICQ_CMDxSUB_CHAT:  // join to current chat
     {
       CEventChat *c = (CEventChat *)m_xCurrentReadEvent;
@@ -869,6 +901,53 @@
 }
 

+void UserViewEvent::slot_btnReadChatmodeView()
+{
+  if (m_xCurrentReadEvent == NULL) return;
+
+  switch (m_xCurrentReadEvent->SubCommand())
+  {
+    case ICQ_CMDxSUB_MSG:  // reply/quote
+    case ICQ_CMDxSUB_URL:
+    case ICQ_CMDxSUB_CHAT:
+    case ICQ_CMDxSUB_FILE:
+      {
+       ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W);
+       u->SetChatmodeView(true);
+       gUserManager.DropUser(u);
+       
+       sendMsg("");
+       break;
+      }
+
+    case ICQ_CMDxSUB_AUTHxREQUEST:
+      (void) new AuthUserDlg(server, ((CEventAuthRequest 
+*)m_xCurrentReadEvent)->Uin(), true);
+      break;
+
+    case ICQ_CMDxSUB_AUTHxGRANTED:
+      server->AddUserToList( ((CEventAuthGranted *)m_xCurrentReadEvent)->Uin());
+      break;
+
+    case ICQ_CMDxSUB_ADDEDxTOxLIST:
+      server->AddUserToList( ((CEventAdded *)m_xCurrentReadEvent)->Uin());
+      break;
+    case ICQ_CMDxSUB_CONTACTxLIST:
+    {
+      const ContactList& cl = 
+static_cast<CEventContactList*>(m_xCurrentReadEvent)->Contacts();
+
+      ContactList::const_iterator it;
+      for(it = cl.begin(); it != cl.end(); ++it) {
+        ICQUser* u = gUserManager.FetchUser((*it)->Uin(), LOCK_R);
+        if(u == NULL)
+          server->AddUserToList((*it)->Uin());
+        gUserManager.DropUser(u);
+      }
+      btnReadChatmodeView->setEnabled(false);
+    }
+  } // switch
+}
+
+
 void UserViewEvent::UserUpdated(CICQSignal *sig, ICQUser *u)
 {
   if (sig->SubSignal() == USER_EVENTS)
@@ -893,8 +972,13 @@
 void UserViewEvent::slot_sentevent(ICQEvent *e)
 {
   if (e->Uin() != m_nUin) return;
-  if (!mainwin->m_bMsgChatView)
+
+  ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R);
+  
+  if (!mainwin->m_bMsgChatView && !u->GetChatmodeView())
     (void) new MsgViewItem(e->GrabUserEvent(), codec, msgView);
+  
+  gUserManager.DropUser(u);
 }
 

@@ -972,11 +1056,17 @@
   splView = new QSplitter(Vertical, mainWidget);
   //splView->setOpaqueResize();
   mleHistory=0;
-  if (mainwin->m_bMsgChatView) {
+  
+  u = gUserManager.FetchUser(m_nUin, LOCK_R);
+  
+  if (mainwin->m_bMsgChatView || u->GetChatmodeView()) {
     mleHistory = new CMessageViewWidget(_nUin,splView);
     connect (mainwin, SIGNAL(signal_sentevent(ICQEvent *)), mleHistory, 
SLOT(addMsg(ICQEvent *)));
     //splView->setResizeMode(mleHistory, QSplitter::FollowSizeHint);
   }
+  
+  gUserManager.DropUser(u);
+  
   mleSend = new MLEditWrap(true, splView, true);
   //splView->setResizeMode(mleSend, QSplitter::Stretch);
   setTabOrder(mleSend, btnSend);
@@ -1252,11 +1342,16 @@
     {
       emit mainwin->signal_sentevent(e);
 
-      if (mainwin->m_bMsgChatView) {
+      ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R);
+      
+      if (mainwin->m_bMsgChatView || u->GetChatmodeView()) {
         mleHistory->GotoEnd();
         resetSettings();
-      } else
+      } else {
         close();
+      }
+      
+      gUserManager.DropUser(u);
     }
   }
 }
@@ -1337,6 +1432,10 @@
 {
   if (!icqEventTag)
   {
+    ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W);
+    u->SetChatmodeView(false);
+    gUserManager.DropUser(u);
+    
     close();
     return;
   }
@@ -1412,7 +1511,13 @@
 {
   QBoxLayout* lay = new QVBoxLayout(mainWidget);
   lay->addWidget(splView);
-  if (!m->m_bMsgChatView) mleSend->setMinimumHeight(150);
+  
+  ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R);
+  
+  if (!m->m_bMsgChatView && !u->GetChatmodeView()) mleSend->setMinimumHeight(150);
+  
+  gUserManager.DropUser(u);
+  
   mleSend->setFocus ();
 
   m_sBaseTitle += tr(" - Message");
@@ -1738,9 +1843,13 @@
 
   QBoxLayout *lay = new QVBoxLayout(mainWidget, 9);
   lay->addWidget(splView);
-
-  if (!m->m_bMsgChatView) mleSend->setMinimumHeight(150);
-
+ 
+  ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R);
+  
+  if (!m->m_bMsgChatView && !u->GetChatmodeView()) mleSend->setMinimumHeight(150);
+  
+  gUserManager.DropUser(u);
+  
   QBoxLayout* h_lay = new QHBoxLayout(lay);
   lblItem = new QLabel(tr("Multiparty: "), mainWidget);
   h_lay->addWidget(lblItem);
@@ -1955,7 +2064,13 @@
 
   QBoxLayout* lay = new QVBoxLayout(mainWidget);
   lay->addWidget(splView);
-  if (!m->m_bMsgChatView) mleSend->setMinimumHeight(150);
+
+  ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R);
+  
+  if (!m->m_bMsgChatView && !u->GetChatmodeView()) mleSend->setMinimumHeight(150);
+  
+  gUserManager.DropUser(u);
+  
   mleSend->setFocus ();
 
   m_sBaseTitle += tr(" - SMS");
diff -urN licq.orig/plugins/qt-gui/src/usereventdlg.h 
licq/plugins/qt-gui/src/usereventdlg.h
--- licq.orig/plugins/qt-gui/src/usereventdlg.h Mon Aug  5 16:04:56 2002
+++ licq/plugins/qt-gui/src/usereventdlg.h      Sun Aug 18 15:31:15 2002
@@ -117,7 +117,7 @@
   MsgView *msgView;
   CUserEvent *m_xCurrentReadEvent;
   QCheckBox* chkAutoClose;
-  QPushButton *btnRead2, *btnRead3, *btnRead4, *btnReadNext;
+  QPushButton *btnRead2, *btnRead3, *btnRead4, *btnReadNext, *btnReadChatmodeView;
   CEButton *btnRead1, *btnClose;
 
   void generateReply();
@@ -134,6 +134,7 @@
   void slot_btnRead3();
   void slot_btnRead4();
   void slot_btnReadNext();
+  void slot_btnReadChatmodeView();
   void slot_printMessage(QListViewItem*);
   void slot_sentevent(ICQEvent *);
   void slot_setEncoding();
diff -urN licq.orig/src/user.cpp licq/src/user.cpp
--- licq.orig/src/user.cpp      Sat Jul 27 15:22:56 2002
+++ licq/src/user.cpp   Sun Aug 18 13:45:58 2002
@@ -1033,6 +1033,7 @@
   }
   m_fConf.CloseFile();
   m_fConf.SetFlags(INI_FxWARN | INI_FxALLOWxCREATE);
+  m_bChatmodeView = false;
 }
 

@@ -1044,6 +1045,7 @@
   snprintf(szFilename, MAX_FILENAME_LEN, "%s/%s/%ld.uin", BASE_DIR, USER_DIR, nUin);
   m_fConf.SetFileName(szFilename);
   m_fConf.SetFlags(INI_FxWARN | INI_FxALLOWxCREATE);
+  m_bChatmodeView = false;
 }
 




-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Licq-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/licq-devel

Reply via email to