Ticket #1442: licq-4756_notice_use_alias.patch

File licq-4756_notice_use_alias.patch, 1.3 kB (added by flynd, 2 years ago)

Patch to display alias instead of protocol id in join/left notices.

  • licq/plugins/qt-gui/src/usereventdlg.cpp

     
    17951795   
    17961796  if (mainwin->m_bMsgChatView) 
    17971797  { 
     1798    ICQUser *u = gUserManager.FetchUser(szId, m_nPPID, LOCK_R); 
     1799    QString userName; 
     1800    if (u) 
     1801      userName = QString::fromUtf8(u->GetAlias()); 
     1802    else 
     1803      userName = szId; 
     1804    gUserManager.DropUser(u); 
     1805 
    17981806    QString strMsg = QString("%1 has joined the conversation.") 
    1799       .arg(szId); 
     1807      .arg(userName); 
    18001808    mleHistory->addNotice(QDateTime::currentDateTime(), strMsg); 
    18011809  } 
    18021810 
     
    18221830   
    18231831  if (mainwin->m_bMsgChatView) 
    18241832  { 
     1833    ICQUser *u = gUserManager.FetchUser(szId, m_nPPID, LOCK_R); 
     1834    QString userName; 
     1835    if (u) 
     1836      userName = QString::fromUtf8(u->GetAlias()); 
     1837    else 
     1838      userName = szId; 
     1839 
    18251840    QString strMsg = QString("%1 has left the conversation.") 
    1826       .arg(szId); 
     1841      .arg(userName); 
    18271842    mleHistory->addNotice(QDateTime::currentDateTime(), strMsg); 
    18281843     
    18291844    // Remove the typing notification if active 
    1830     ICQUser *u = gUserManager.FetchUser(szId, m_nPPID, LOCK_W); 
    18311845    if (u && u->GetTyping() == ICQ_TYPING_ACTIVE) 
    18321846    { 
    18331847      u->SetTyping(ICQ_TYPING_INACTIVEx0);