Hey,
> Til now I've used the same mechanism as when loading
currently received
> messages. It's more natural I think, because I get
messages from history
> as message events that are the same events when new
messages are
> received. If I do it like you said I should process
them one by one then
> save them as html and after that insert them in the
document. Do you
> think it's worth it?
Yes, because right now the gui is revalidated after each
message that
you append and it's this revalidation that slows down the
whole thing.
Whereas if you process them all together you could show them
all with a
single repaint (i.e. 10 times less ;) ).
> I could try this. For now I insert the message in the
same thread where
> history messages are loaded. WDYT about that?
I think it would be better not to do so. You could add new
incoming
messages as they arrive, and only use the history thread to
insert the
history messages at index 0. Otherwise, if you do the
concatenation of
the new message and the history messages yourself, you would
face the
same race condition problem in the case where you have
multiple incoming
messages. For example: if history messages are H, and you
have a new
message A. As long as A is the only new message it would be
ok for you to do
msgPane.append(H + A);
but the situation changes if while you are doing the
concatenation you
receive a new message B. You risk to end up with a
B
H
A
sequence in the message pane.
Wouldn't it be simpler to do
MessageReceptionThread
{
msgPane.append(newMsg)
}
HistoryMessagesThread
{
msgPane.insert(0, historyMessages)
}
WDYT?
Emil
>> Emil
>>
>>> Thanks,
>>> Yana
>>>
>>>
------------------------------------------------------------
---------
>>> To unsubscribe, e-mail: dev-unsubscribe sip-communicator.dev.java.net
>>> For additional commands, e-mail: dev-help sip-communicator.dev.java.net
>>>
>>>
>>
------------------------------------------------------------
---------
>> To unsubscribe, e-mail: dev-unsubscribe sip-communicator.dev.java.net
>> For additional commands, e-mail: dev-help sip-communicator.dev.java.net
>>
>>
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribe sip-communicator.dev.java.net
> For additional commands, e-mail: dev-help sip-communicator.dev.java.net
>
>
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe sip-communicator.dev.java.net
For additional commands, e-mail: dev-help sip-communicator.dev.java.net
|