pidgin/pidgin

741992355ead
GSoC History API including sqlite history adapter

The History API has been created to drive all message handling in purple3. It will be used to update existing messages for edits, reactions, pinning, read/deliver receipts, etc. The API uses an adapter pattern, to abstract out backends, but provides a SQLite3 backend by default.

It also provides search capabilities using a custom query language that can easily be expanded over time. It will be use by both the end user to search messages and the frontends to implement features like a pinned messages button. A command line utility is also provided for searching outside of the program itself.

## Remaining Items

**These all will most likely be done by the Pidgin core team after GSoC when we figure out exactly how to solve them.**

Need to store database in purple config directory
* Gary has spent some time looking at this and it looks like the purple-history cli will need to become a purple-ui to make this work write as in the future other adapters will be plugins.

Other things to consider:
- For simplicity, the SqliteHistoryAdapter is parsing the query itself, but for consistency having `PurpleHistoryAdapter` parse the query and pass tokens to the subclass might be something we want to do.

Testing Done:
## Unit Tests
History Manager
History Adapter

## Integration Tests
purplehistorycore created for integration tests.
PurpleSqliteHistoryAdapter functionality tested:
- Creates proper db schema
- Writes logs
- Reads logs
- Queries using query language
- Deletes using query language

Bugs closed: PIDGIN-17526, PIDGIN-17532, PIDGIN-17533, PIDGIN-17534

Reviewed at https://reviews.imfreedom.org/r/877/
# When turned on, this option causes gtk to select the contents of an entry field when it becomes focused.
gtk-entry-select-on-focus = 1
# Sets the font used by gtk
gtk-font-name = "Verdana 9"
# Controls the keybindings that gtk uses for text entry/editing/etc
# The "emacs" theme turns on things like:
# ctrl-a == move to beginning of line, ctrl-e == move to end of line, etc.
gtk-key-theme-name = "Emacs"
# The following section allows you to change the style of the conversation
# window widgets, log viewer widget, and request and notify window widgets.
style "imhtml-fix"
{
font_name = "Sans 10"
}
# Set the widget style for the conversation entry box
widget "*pidgin_conv_entry" style "imhtml-fix"
# Set the widget style for the conversation
widget "*pidgin_conv_imhtml" style "imhtml-fix"
# Set the widget style for the log viewer
widget "*pidgin_log_imhtml" style "imhtml-fix"
# Set the widget style for IMHtml input widgets in request dialogs
widget "*pidgin_request_imhtml" style "imhtml-fix"
# Set the widget style for IMHtml widgets in notify dialogs
widget "*pidgin_notify_imhtml" style "imhtml-fix"
# It is safe to remove any undesired settings from the following
style "my-style-name" {
# Change the color of hyperlinks.
GtkIMHtml::hyperlink-color = "#000080"
# Change the color of the nick in highlighted messages, e.g. messages containing your nick
GtkIMHtml::highlight-name-color = "#AF7F00"
# Change the color of the nick in received message
GtkIMHtml::receive-name-color = "#cc0000"
# Change the color of the nick in sent message
GtkIMHtml::send-name-color = "#204a87"
# Change the color of the nick in action messages, e.g. "/me likes pidgin"
GtkIMHtml::action-name-color = "#062585"
# Change the font of the typing notification in conversation history.
GtkIMHtml::typing-notification-font = "italic light 8.0"
# Change the color of the typing notification
GtkIMHtml::typing-notification-color = "#ff0000"
# Disable the typing notification
GtkIMHtml::typing-notification-enable = 0
# The following settings will change the behaviour in all GTK+ applications
# Change the cursor color
GtkWidget::cursor-color = "#0000FF"
GtkWidget::secondary-cursor-color = "#00FF00" #for mixed ltr and rtl
}
widget_class "*" style "my-style-name"
# This sets the expander size on a treeview to 0, which has the result
# of reducing the indent for items in the tree. This can be applied to the
# Pidgin buddy list to reduce the width of group and contact rows.
# With the recent (~2.0.0) buddy list changes this isn't particularly
# important anymore.
#style "my-narrow-tree"
#{
# GtkTreeView::expander_size = 0
#}
# And apply the style to the buddy list:
#widget "*pidgin_blist_treeview" style "my-narrow-tree"
# In Pidgin, you can set custom keybindings in your theme.
# Here is an example to follow:
binding "my-bindings"
{
# enter inserts a newline
bind "Return" { "insert-at-cursor" ("\n") }
# ctrl-s sends message
bind "<ctrl>s" { "message_send" () }
# shift-f1 toggles bold
bind "<shft>F1" { "format_toggle" (1) }
# alt-f2 toggles italic
bind "<alt>F2" { "format_toggle" (2) }
# Ctrl-alt-shift-f3 toggles underline
bind "<ctrl><alt><shift>F3" { "format_toggle" (4) }
# Ctrl-v to paste as plain text
bind "<ctrl>v" { "paste" ("text") }
# Ctrl-Shift-v for normal 'Paste'
bind "<ctrl><shift>v" { "paste" ("html") }
}
widget "*pidgin_conv_entry" binding "my-bindings"
# This lets you edit your Pidgin key bindings from within Pidgin,
# by hovering over a menu item and hitting a key combo.
gtk-can-change-accels = 1