Changeset 5974 for branches/newosd

Show
Ignore:
Timestamp:
01/01/08 02:35:22 (11 months ago)
Author:
eugene
Message:

More message processing.

Location:
branches/newosd/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/newosd/src/iface.cpp

    r5973 r5974  
    3939  if (max_width > 0) 
    4040    pango_layout_set_width(trd.lay, max_width * PANGO_SCALE); 
     41  pango_layout_set_wrap(trd.lay, PANGO_WRAP_WORD_CHAR); 
    4142} 
    4243 
     
    5657    { 
    5758      if (!checkDisabledTimer() || 
    58           !checkOwner(sig->Id(), sig->PPID())) 
     59          !checkOwner(sig)) 
    5960        break; 
    6061 
     
    7677 
    7778        case USER_EVENTS: 
     79          if (sig->Argument() < 0) 
     80            break; 
     81 
     82          if (sig->Argument() == 0) 
     83          { 
     84            msg = u->GetAlias(); 
     85            msg += " checked your auto-response"; 
     86            break; 
     87          } 
     88 
     89          { 
     90            CUserEvent* ue = u->EventPeekId(sig->Argument()); 
     91            if (ue == NULL) 
     92              break; 
     93            msg = setLayoutTag(u); 
     94            char* trans = gTranslator.ToUnicode(const_cast<char*>(ue->Text()), 
     95                u->UserEncoding()); 
     96            msg += trans; 
     97            delete[] trans; 
     98          } 
    7899          break; 
    79100 
     
    124145} 
    125146 
    126 bool Iface::checkOwner(char* id, unsigned long ppid) 
    127 { 
    128   ICQOwner* o = gUserManager.FetchOwner(ppid, LOCK_R); 
     147bool Iface::checkOwner(CICQSignal* sig) 
     148{ 
     149  ICQOwner* o = gUserManager.FetchOwner(sig->PPID(), LOCK_R); 
    129150 
    130151  if (o == NULL) 
     
    135156  do 
    136157  { 
    137     if (strcmp(id, o->IdString()) == 0) 
     158    // TODO status check 
     159 
     160    if (sig->Signal() == SIGNAL_UPDATExUSER && 
     161        sig->SubSignal() == USER_EVENTS && 
     162        sig->Argument() > 0) 
     163      break; 
     164 
     165    if (strcmp(sig->Id(), o->IdString()) == 0) 
    138166    { 
    139167      ret = false; 
     
    141169    } 
    142170 
    143     // TODO status check 
    144171  } while (false); 
    145172 
    146   gUserManager.DropOwner(ppid); 
     173  gUserManager.DropOwner(sig->PPID()); 
    147174  return ret; 
    148175} 
  • branches/newosd/src/iface.h

    r5973 r5974  
    2525 
    2626  ICQUser* checkUser(char* id, unsigned long ppid); 
    27   bool checkOwner(char* id, unsigned long ppid); 
     27  bool checkOwner(CICQSignal* sig); 
    2828  bool checkDisabledTimer(); 
    2929