BUG:
When I try to send a message, it is never received by
the target user
CAUSE 1:
All the connections will be saved with your own handle
instead of with the other users handle..
SOLUTION 1:
To solve this there should change a line in the private
void handleRNG(Response res):
m_connections.put(handle, conn);
should be
m_connections.put(callingUserHandle, conn);
CAUSE 2:
The second cause is in the public void
sendMessage(String handle, MimeMessage message). I
guess this part is added for multi-user chats, but it
blocks sending messages to a single user:
if (!conn.m_chatUsers.contains(new User(handle)))
{
try
{
conn.sendCall(handle);
conn.waitForJoin(handle);
}
catch (ConnectionException ex)
{
if (DEBUG) ex.printStackTrace();
throw new ConnectionException("Could not call user");
}
}
conn.m_chatUsers is only filled upon receiving a JOI
command. Unfortunately this command is only received
when ANOTHER user joins a session, not when you are the
one that joins. MSN Messenger Service 1.0 Protocol
states in chapter 8.5:
When a new user joins a Switchboard session, the
server sends the
following command to all participating clients,
including the client
joining the session:
S: JOI CalleeUserHandle CalleeUserFriendlyName
Here you can read that even if you join you should get
the JOI command, but I did not get it (other user uses
MSN Messenger 5.0.0544 with MSN Plus). I don't know how
this should be handled. Maybe fill conn.m_chatUsers
upon receiving a RNG command.
also the variable name 'handle' in the sendMessage
function confused me, because in some other functions
this is named the callingUserHandle (as in Solution 1).
Logged In: YES
user_id=775286
Scratch Cause 2!! that one is fine..
It's all in the first cause..
greetings again,
Sietse