Changeset 232

Show
Ignore:
Timestamp:
07-03-2008 17:47:03 (5 years ago)
Author:
jppavao
Message:

Fixed the typing notifications that were not being cancelled correctly. Also, now we send a message cancel event when the user closes a chat window containing text in the input text field that never got to be sent. Refs #8.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/core/lfp_api.cpp

    r227 r232  
    32283228                m.setTo(chat->jid); 
    32293229                m.setType("chat"); 
    3230                 if (typing) 
    3231                         m.addEvent(ComposingEvent); 
     3230                m.addEvent(typing ? ComposingEvent : CancelEvent); 
    32323231                m.setEventId(chat->lastReceivedMessageID); 
    32333232                chat->entry->account->client()->sendMessage(m); 
  • trunk/lilypad/Sources/LPChatController.m

    r229 r232  
    20492049        [[[aNotification object] drawers] makeObjectsPerformSelector:@selector(close)]; 
    20502050         
     2051        // Cancel the pending chat typing notification if there was some text already entered but not yet sent 
     2052        if (m_lastInputTextFieldStringLength > 0) 
     2053                [m_chat setUserIsTyping:NO]; 
    20512054        [m_chat endChat]; 
    20522055        [m_chat setDelegate:nil];