| 
      
      
      From: Denis V. D. <de...@nu...> - 2001-01-12 11:12:18
      
     | 
| Bill Soudan <we...@ri...> writes:
I've removed crossposting to Michael Hudson since he's already subscribed
to this list. ;)
> I'm also tossing around the idea of leaving the old methods in for
> convenience.  So someone could still use icq_SendMessage(icqlink, uin,
> message) for instance.  It will be up to the coder to decide which
> interface to use - the functional interface will probably work better for
> quick and dirty programs and scripts, while the event structure would
> probably work better for larger, object-oriented applications because
> they can use them directly.
How hard do you think it will be to implement/support both APIs?
> A few example timelines:
> 
> client:  icq_SendEvent(icqlink, login_event, ICQ_SEND_BESTWAY)==1;
ICQ_SEND_THRUSERVER is better since sending login via TCP isn't actually
possible (at least with the current protocols we support)
> library: 1 ICQ_NOTIFY_SENT
>            ... (time goes by while waiting for ack)
>          1 ICQ_NOTIFY_ACK - once received from the server
>          1 ICQ_NOTIFY_SUCCESS - this event has been transmitted
>                                 successfully
> 
>   * NOTE: ICQ_NOTIFY_SUCCESS doesn't mean the LOGIN proceduce completed
>     successfully, only that the request was transmitted successfully.
>     You must wait for the ICQ_EVENT_LOGIN_SUCCESS event to be received from the
>     server.
> 
> client:  icq_SendEvent(icqlink, message_event, ICQ_SEND_BESTWAY)==2;
> library: 2 ICQ_NOTIFY_CONNECTING
>            ... (delay during connect)
>          2 ICQ_NOTIFY_CONNECTED
>          2 ICQ_NOTIFY_SENT
>            ... (delay waiting for ack)
>          2 ICQ_NOTIFY_ACK
>          2 ICQ_NOTIFY_SUCCESS
> 
> client:  icq_SendEvent(icqlink, message_event, ICQ_SEND_THRUSERVER)==3;
> library: 3 ICQ_NOTIFY_SENT
>            ... (packet lost, server never acks)
>          3 ICQ_NOTIFY_SENT
>            ...
>          3 ICQ_NOTIFY_ACK
>          3 ICQ_NOTIFY_SUCCESS
> 
> client:  icq_SendEvent(icqlink, search_event, ICQ_SEND_BESTWAY)==4;
The same thing with search - this is server command, so use
ICQ_SEND_THRUSERVER instead of ICQ_SEND_BESTWAY.
> library: 4 ICQ_NOTIFY_SENT
>            ...
>          4 ICQ_NOTIFY_ACK
>          4 ICQ_NOTIFY_SUCCESS
> 
> ... icq_UserFoundEvents come in on icq_EventReceived for a while
> ... icq_SearchDoneEvents comes in
> 
> * old callbacks -> new events and some example structures
> 
> // icq_ExtInfoReply - ICQ_EVENT_EXTENDED_INFO_REPLY
> 
> typedef struct icq_ExtendedInfoReply_s {
> 
>    unsigned long uin;
>    int country_code;
>    char country_stat;
>    const char *city;
>    const char *state;
>    int age;
>    char gender;
>    const char *phone;
>    const char *hp; // ??
This is homepage ;)
>    const char *about;
> 
> } icq_ExtendedInfoReply;
> 
> // icq_WrongPassword - ICQ_EVENT_INVALID_PASSWORD
> 
> // icq_InvalidUIN - ICQ_EVENT_INVALID_UIN
> 
> // icq_SrvAck - this would be passed back through icq_RequestNotify
Looks great! I haven't seen "struct icq_Event" though.
-- 
Denis V. Dmitrienko | E-mail: de...@nu... | ICQ#: 5538614
Home page: http://denix.org
History became legend... Legend became myth.
And some things that should not have been forgotten ...were lost.
 |