之前一直不知道怎么把这个记录给删掉,烦死了。可不能留下私密信息在这里阿,就下载了Empathy源码下来看一下检查一下。好像Empathy的文档没有有,我没仔细看,反正网上的文档搜到的文档说的位置是错的,可能因为Empathy 更新了吧。
根据代码,Empathy使用的是 Telepathy 框架,所以这个 聊天记录使用的也是“Telepathy Logger”这个模块来作的。Telepathy Logger的文档在 ,提到
--------------
It stores its logs to
${XDG_DATA_HOME}/share/TpLogger
which usually expands to at
${HOME}/.local/share/TpLogger/
--------------------
我到我自己的 home 目录 /home/widebright/.local/share/TpLogger/logs
下面一看,果然聊天记录都在这里,yahoo messager 和spark的记录都保存在 帐号名字/联系人名字/聊天日期.log 这样的子目录的文件里面,明文 的xml格式的。
我把把这下面的东西都清空了。然后在Empathy 里面设置了不保存密码。这下终于放心了。
看代码的时候,发现这个Empathy的聊天记录界面,还是用webkit来做的。很有意思,有的树型节点的操作、显示那些都是写在html的javascript里面,然后在gtk里面调用的,很有意思。如果想在gtk窗口上面嵌入一个浏览器窗口作显示的,也可以参考这个代码吧。我之前就不知道这个webkit还能这样用的。
-------------------------------
./empathy-main-window.c
static void
main_window_view_history_cb (GtkAction *action,
EmpathyMainWindow *window)
{
empathy_log_window_show (NULL, NULL, FALSE, GTK_WINDOW (window));
}
-------------------------------------------------
./libempathy-gtk/empathy-log-window.c:empathy_log_window_show (TpAccount *account,
GtkWidget *
empathy_log_window_show (TpAccount *account,
const gchar *chat_id,
gboolean is_chatroom,
GtkWindow *parent)
{
log_window = g_object_new (EMPATHY_TYPE_LOG_WINDOW, NULL);
gtk_window_present (GTK_WINDOW (log_window));
if (account != NULL && chat_id != NULL)
select_account_once_ready (log_window, account, chat_id, is_chatroom);
if (parent != NULL)
gtk_window_set_transient_for (GTK_WINDOW (log_window),
GTK_WINDOW (parent));
return GTK_WIDGET (log_window);
}
static void
empathy_log_window_init (EmpathyLogWindow *self)
{
EmpathyAccountChooser *account_chooser;
GtkBuilder *gui;
gchar *filename;
GFile *gfile;
GtkWidget *vbox, *accounts, *search, *label, *closeitem;
GtkWidget *scrolledwindow_events;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
EMPATHY_TYPE_LOG_WINDOW, EmpathyLogWindowPriv);
self->priv->chain = _tpl_action_chain_new_async (NULL, NULL, NULL);
self->priv->camera_monitor = empathy_camera_monitor_dup_singleton ();
self->priv->log_manager = tpl_log_manager_dup_singleton ();
self->priv->gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
self->priv->gsettings_desktop = g_settings_new (
EMPATHY_PREFS_DESKTOP_INTERFACE_SCHEMA);
gtk_window_set_title (GTK_WINDOW (self), _("History"));
gtk_widget_set_can_focus (GTK_WIDGET (self), FALSE);
gtk_window_set_default_size (GTK_WINDOW (self), 800, 600);
filename = empathy_file_lookup ("empathy-log-window.ui", "libempathy-gtk");
gui = empathy_builder_get_file (filename,
"vbox1", &self->priv->vbox,
"toolbutton_profile", &self->priv->button_profile,
"toolbutton_chat", &self->priv->button_chat,
"toolbutton_call", &self->priv->button_call,
"toolbutton_video", &self->priv->button_video,
"toolbutton_accounts", &accounts,
"toolbutton_search", &search,
"imagemenuitem_close", &closeitem,
"treeview_who", &self->priv->treeview_who,
"treeview_what", &self->priv->treeview_what,
"treeview_when", &self->priv->treeview_when,
"scrolledwindow_events", &scrolledwindow_events,
"notebook", &self->priv->notebook,
"spinner", &self->priv->spinner,
NULL);
g_free (filename);