Exemple #1
0
// note, DO NOT FREE Buffer after calling,  Buffer is freed after it is processed.
void IRCCommon::AddToOutputBuffer(int Contents, char *Buffer)
{  
  time(&m_LastActivityTime);

  if (m_pChildWnd && !::IsWindow(m_pChildWnd->m_hWnd))
    return;
  // Set the dirty flag is the window is NOT active, (or the window is active, but hidden)

  if (!ProcessSimpleFilter(m_DirtyFilterList,Contents))
  {
    time(&m_DirtyTime); // update the time of the last thing that made the window dirty
    if (!(m_Dirty & DIRTY_RECENT))
    {      
      m_Dirty |= DIRTY_RECENT;// if we didn't filter it, then set the DIRTY_RECENT flag.

      if (!(m_Dirty & DIRTY_TRUE)) // speed things up a bit!
      {

        HWND hWnd = g_pMainWnd->MDIGetActive();
        if (m_pChildWnd && 
            ((m_pChildWnd->m_hWnd != hWnd) || 
            (m_pChildWnd->m_hWnd == hWnd && !m_pChildWnd->IsWindowVisible() )) )
        {
          m_Dirty |= DIRTY_TRUE; // if we didn't filter it, then set the DIRTY_TRUE flag.
        }
      }
    }
  }

  m_TicksSinceLastBufferAdd = 0;
  m_OutputBuffer.Add(new BufferItem(Contents,Buffer));
  if (m_pChildWnd)
    m_pChildWnd->PostMessage(WM_BUFFERWAITING,0,0);
}
Exemple #2
0
void CServerMonitorView::Put(IRCServer *pServer, BufferItem *pBI)
{
  char *monitorstr;

  if (!ProcessSimpleFilter(g_DefaultFilterList_ServerMonitor,pBI->m_Contents))
  {
    monitorstr = HydraIRC_BuildString(1024,"%s: %s",pServer->m_pDetails->m_Name, pBI->m_Buffer);
    if (monitorstr)
    {
      m_MsgView.Put(pBI->m_Contents, monitorstr);
      free(monitorstr);
    }
  }
}