hi daniel,
i am talking about duplicate iq packets in the first connection and about lots of presence packets of just one user.
duplicate iq problems: when a user first connects to any service (msn, gtalk, icq etc), the gateway sync the roster. In this process, you get two iq packets per your contact. first iq contains only the jid with a “none” subscription, and then gateway sends another iq packet, which has the name of the user, for this user. So the first iq is sent by openfire because of the following code in the BaseTransport class.
// Create new roster item for the gateway service or legacy contact. Only
// roster items related to the gateway service will be persistent. Roster
// items of legacy users are never persisted in the DB.
RosterItem gwitem = roster.createRosterItem(contactjid, true, contactjid.getNode() == null);
in this code, while creating new roster item, gateway pushes the new roster item to the client, which i believe that it shouldn’'t. Because in the next lines, it will push the roster with:
roster.updateRosterItem(gwitem);
so the gateway should call the “createRosterItem” method with false in the 2nd argument, which decides pushing the newly created roster item.
lots of presence packets: in fact this is not a bug or error. but it is a thing that can be optimized. while we start the services (msn, gtalk etc, ‘‘i do not know how you call these’’), their listeners begin to listen and process what they get as soon as possible. but for the presences changes, we need to make presence listeners wait until we sync the rosters. Because in the “syncUsers()” method, we already send the initial prences of our roster items. (of course, this is not a solution for the msn UBX packets, it is normal that you can get 2 presence for the user anyway.)
as a conclusion, by fixing (maybe wrong word) the above codes, i can sign an msn users, that has a 21 contacts, with just ~7kb in stead of ~18kb. Since my client is mobile ( http://www.cepteki.net - english version is in progress) 11kb is really a big traffic.
after my tests, i will post my codes in here, so you can test that also.
(sorry for my poor english, i hope i was clear.)