On Sat, May 30, 2009 at 6:28 PM, Olivier Goffart <[email protected]> wrote:
> Le Lørdag 30 mai 2009, roide a écrit : > > Hi,In this summer of code, i m working on the project, KDE-Conversation > > logging framework. > > A part of the project is to Modify the history plugin of Kopete such > that > > it saves its chat in Akonadi. > > > > In the process of modification, we decided that it is a good idea to > > replace the QDomDocument with the History object, that represents a > > chatLog. While trying to understand the code of the function given > > below,(as is uses QDomNode, and Element everywhere), i though it would be > a > > good idea, to get mylogic clear, about the algorithm that is used in this > > function. > > > After spending a lot of time, in understanding this function, > > The algorithm i have understood here is that, > > The function has to return a number of lines of chat of a particular > > contact. > > IF the contact is given then just read the history and return it(easy > part) > > if the contact is not given, and the metacontact has more than one > contact. > > merge the history(confusing here), > > How merging works is. if there are more than one contact, Find out the > > Contact which has the chat with smallest/largest date (depends on the > > chronological order). Note the date. Then find out another contact Which > > has a message with date just below or above the first chosen contact. > > Now return the list of chat messages that lie between these two dates.. > > > > Have i understood the logic correctly or have i missed something here ? > > You understood The logic. > (I know the comment in the code are not all proper English, but I wasn't > speaking English well at the tie :-)) > > If you have severals contact in the same metacontact, and you want the > hostory > for the metaconcact, we want to merge the history that are in different > file > inside one "stream" and all the message has to be sorted. > > The individual stream are already sorted, it is now just a matter of > merging > them. > > Do you understand now? Yes, i got it. :) So basically, the list of messages it will return is, which contains messages from chatfiles of different contacts(belonging to same metacontact), but are sorted with respect to timestamp. right? -- Greetings, [email protected] roideuniverse.blogspot.com
_______________________________________________ kopete-devel mailing list [email protected] https://mail.kde.org/mailman/listinfo/kopete-devel
