... | ... | @@ -23,6 +23,8 @@ For reference, here's the relevevant discussion from the Gajim MUC (where `erik` |
|
|
|
|
|
## High level assessment of the existing code base
|
|
|
|
|
|
### Functional overview
|
|
|
|
|
|
`ConversationTextview` is tightly coupled with `HtmlTextview` as it highly depends on the fact that the HtmlTextview is an editor: it directly accesses the editor buffer and uses it all over the place.
|
|
|
|
|
|
On the other side, `HistoryWindow` and `ChatControlBase` depend on `ConversationTextview` to display the list of messages, where `HistoryWindow` uses some of the api provided by `ConversationTextview` to populate the window and does some formatting of its own. `ChatControlBase` leaves formatting of messages entirely to `ConversationTextview`.
|
... | ... | @@ -37,8 +39,34 @@ The view performs the following functions: |
|
|
* Adding the nick of the sender
|
|
|
* Scanning and formatting URLs in message text
|
|
|
* Formatting non-message lines (such as status messages, muc title, etc.)
|
|
|
|
|
|
* Deal with all user-interactions through the registration of various event handlers (popup menu, clicking of URLs, etc.)
|
|
|
|
|
|
The `HtmlTextview` adds a single function to the above: parsing the provided content for `xhtml-im` content (and cleaning non-compliant content).
|
|
|
|
|
|
### Technical overview
|
|
|
|
|
|
`ConversationTextview` maintains the following API to achieve the formatting functions:
|
|
|
* print_empty_line
|
|
|
* print_conversation_line
|
|
|
* print_encryption_status
|
|
|
* print_real_text
|
|
|
* print_time
|
|
|
* print_name
|
|
|
* print_subject
|
|
|
* get_end_mark
|
|
|
* get_insert_mark
|
|
|
* (creation and updates of `HtmlTextview.get_buffer()`-tags in various places)
|
|
|
|
|
|
For the mappings it maintains the following functions and attributes:
|
|
|
* correct_message [function]
|
|
|
* message_list [attribute]
|
|
|
* last_received_message_id [attribute]
|
|
|
|
|
|
`HtmlTextview` manages presentation with the following functions:
|
|
|
* update_tags
|
|
|
* display_html (which is also responsible for handling `xhtml-im`)
|
|
|
|
|
|
### Concluding
|
|
|
|
|
|
From the summary above, it seems like `ConversationTextview` is all of the model, the view and the controller: it maintains the data to be presented in all its aspects (model), it generates/manages presentation by virtue of the various `print_*` methods (view) and it deals with various signals (e.g. user input) which affect presentation as well as other actions such as starting external browsers and all.
|
|
|
|