Changeset 5601

Show
Ignore:
Timestamp:
10/11/07 17:53:03 (14 months ago)
Author:
eugene
Message:
  • Made notice strings translatable;
  • take the usereventcommon private PPID instead of a constant one to generate the real user id;
  • tiny coding style update;
  • made history view scroll to the end upon adding a notice;
  • revised the convo(Join|Leave) logic, which must fix #1392.
Location:
branches/qt-gui_qt4/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/qt-gui_qt4/src/historyview.cpp

    r5577 r5601  
    488488 
    489489  internalAddMsg(s); 
    490 } 
     490  GotoEnd(); 
     491} 
  • branches/qt-gui_qt4/src/mainwin.cpp

    r5598 r5601  
    14261426} 
    14271427 
    1428 void MainWindow::slot_socket(QString id, unsigned long ppid, unsigned long nConvoId) 
    1429 { 
    1430   // Add the user to an ongoing conversation 
     1428void MainWindow::slot_socket(QString id, unsigned long ppid, unsigned long convoId) 
     1429{ 
    14311430  for (int i = 0; i < licqUserSend.size(); ++i) 
    14321431  { 
     
    14341433    if (item->id() == id && item->ppid() == ppid) 
    14351434    { 
    1436       item->setConvoId(nConvoId); 
    1437       break; 
    1438     } 
    1439   } 
    1440 } 
    1441  
    1442 void MainWindow::slot_convoJoin(QString id, unsigned long /* ppid */, unsigned long nConvoId) 
    1443 { 
    1444   // Add the user to an ongoing conversation 
     1435      item->setConvoId(convoId); 
     1436      break; 
     1437    } 
     1438  } 
     1439} 
     1440 
     1441void MainWindow::slot_convoJoin(QString id, unsigned long ppid, unsigned long convoId) 
     1442{ 
    14451443  for (int i = 0; i < licqUserSend.size(); ++i) 
    14461444  { 
    14471445    UserSendCommon* item = licqUserSend.at(i); 
    1448     if (item->convoId() == nConvoId) 
    1449     { 
    1450       item->convoJoin(id, nConvoId); 
    1451       return; 
    1452     } 
    1453   } 
    1454  
    1455   // No conversation shown, so make one 
    1456  
    1457 } 
    1458  
    1459 void MainWindow::slot_convoLeave(QString id, unsigned long /* ppid */, unsigned long nConvoId) 
    1460 { 
    1461   // Add the user to an ongoing conversation 
     1446    if (item->ppid() == ppid && item->convoId() == convoId) 
     1447    { 
     1448      item->convoJoin(id, convoId); 
     1449      break; 
     1450    } 
     1451  } 
     1452} 
     1453 
     1454void MainWindow::slot_convoLeave(QString id, unsigned long ppid, unsigned long convoId) 
     1455{ 
    14621456  for (int i = 0; i < licqUserSend.size(); ++i) 
    14631457  { 
    14641458    UserSendCommon* item = licqUserSend.at(i); 
    1465     if (item->convoId() == nConvoId) 
    1466     { 
    1467       item->convoLeave(id, nConvoId); 
    1468       return; 
     1459    if (item->ppid() == ppid && item->convoId() == convoId && 
     1460        item->isUserInConvo(id)) 
     1461    { 
     1462      item->convoLeave(id, convoId); 
     1463      break; 
    14691464    } 
    14701465  } 
  • branches/qt-gui_qt4/src/userevents/usersendcommon.cpp

    r5591 r5601  
    509509      userName = id; 
    510510 
    511     QString strMsg = QString("%1 has joined the conversation.").arg(userName); 
    512     mleHistory->addNotice(QDateTime::currentDateTime(), strMsg); 
     511    mleHistory->addNotice(QDateTime::currentDateTime(), 
     512        tr("%1 has joined the conversation.").arg(userName)); 
    513513  } 
    514514 
     
    516516  { 
    517517    char* realId; 
    518     //XXX The PPID? 
    519     ICQUser::MakeRealId(id.toLatin1(), LICQ_PPID, realId); 
     518    ICQUser::MakeRealId(id.toLatin1(), myPpid, realId); 
    520519    myUsers.push_back(realId); 
    521520    delete [] realId; 
     
    543542      userName = id; 
    544543 
    545     QString strMsg = QString("%1 has left the conversation.").arg(userName); 
    546     mleHistory->addNotice(QDateTime::currentDateTime(), strMsg); 
     544    mleHistory->addNotice(QDateTime::currentDateTime(), 
     545        tr("%1 has left the conversation.").arg(userName)); 
    547546 
    548547    // Remove the typing notification if active