aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/empathy-account-assistant.c2
-rw-r--r--src/empathy-chat-manager.c4
-rw-r--r--src/empathy-chat-window.c9
-rw-r--r--src/empathy-event-manager.c77
-rw-r--r--src/empathy-preferences.c11
-rw-r--r--src/empathy-preferences.ui14
-rw-r--r--src/empathy-sidebar.c2
-rw-r--r--src/empathy.c4
8 files changed, 82 insertions, 41 deletions
diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c
index 585916903..e302aaf66 100644
--- a/src/empathy-account-assistant.c
+++ b/src/empathy-account-assistant.c
@@ -1120,7 +1120,7 @@ account_assistant_build_salut_page (EmpathyAccountAssistant *self)
gtk_box_pack_start (GTK_BOX (main_vbox), hbox_1, TRUE, TRUE, 0);
gtk_widget_show (hbox_1);
- w = gtk_label_new ("");
+ w = gtk_label_new (NULL);
markup = g_strdup_printf ("%s (<span style=\"italic\">%s</span>).",
_("Empathy can automatically discover and chat with the people "
"connected on the same network as you. "
diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c
index fdc4451dd..cfa38ec84 100644
--- a/src/empathy-chat-manager.c
+++ b/src/empathy-chat-manager.c
@@ -385,10 +385,10 @@ empathy_chat_manager_undo_closed_chat (EmpathyChatManager *self)
if (data->room)
empathy_dispatcher_join_muc (data->account, data->id,
- EMPATHY_DISPATCHER_NON_USER_ACTION);
+ TP_USER_ACTION_TIME_NOT_USER_ACTION);
else
empathy_dispatcher_chat_with_contact_id (data->account, data->id,
- EMPATHY_DISPATCHER_NON_USER_ACTION);
+ TP_USER_ACTION_TIME_NOT_USER_ACTION);
g_signal_emit (self, signals[CHATS_CHANGED], 0,
g_queue_get_length (priv->queue));
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 27d6dd874..e7e5f858e 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1761,7 +1761,7 @@ chat_window_drag_data_received (GtkWidget *widget,
/* Added to take care of any outstanding chat events */
empathy_chat_window_present_chat (chat,
- EMPATHY_DISPATCHER_NON_USER_ACTION);
+ TP_USER_ACTION_TIME_NOT_USER_ACTION);
/* We should return TRUE to remove the data when doing
* GDK_ACTION_MOVE, but we don't here otherwise it has
@@ -2355,15 +2355,12 @@ empathy_chat_window_present_chat (EmpathyChat *chat,
/* Don't force the window to show itself when it wasn't
* an action by the user
*/
- if (timestamp == EMPATHY_DISPATCHER_NON_USER_ACTION)
+ if (!tp_user_action_time_should_present (timestamp, &x_timestamp))
return;
priv = GET_PRIV (window);
- if (timestamp == EMPATHY_DISPATCHER_CURRENT_TIME) {
- x_timestamp = GDK_CURRENT_TIME;
- } else {
- x_timestamp = CLAMP (timestamp, 0, G_MAXUINT32);
+ if (x_timestamp != GDK_CURRENT_TIME) {
/* Don't present or switch tab if the action was earlier than the
* last actions X time, accounting for overflow and the first ever
* presentation */
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index e678f990c..fdd0672ee 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -308,14 +308,11 @@ event_manager_approval_approve (EventManagerApproval *approval)
if (approval->auto_approved)
{
- timestamp = EMPATHY_DISPATCHER_NON_USER_ACTION;
+ timestamp = TP_USER_ACTION_TIME_NOT_USER_ACTION;
}
else
{
- timestamp = gtk_get_current_event_time ();
-
- if (timestamp == GDK_CURRENT_TIME)
- timestamp = EMPATHY_DISPATCHER_CURRENT_TIME;
+ timestamp = tp_user_action_time_from_x11 (gtk_get_current_event_time ());
}
g_assert (approval->operation != NULL);
@@ -334,9 +331,9 @@ static void
event_text_channel_process_func (EventPriv *event)
{
EmpathyTpChat *tp_chat;
- gint64 timestamp = gtk_get_current_event_time ();
- if (timestamp == GDK_CURRENT_TIME)
- timestamp = EMPATHY_DISPATCHER_CURRENT_TIME;
+ gint64 timestamp;
+
+ timestamp = tp_user_action_time_from_x11 (gtk_get_current_event_time ());
if (event->approval->handler != 0)
{
@@ -730,34 +727,28 @@ event_room_channel_process_func (EventPriv *event)
}
static void
-event_manager_muc_invite_got_contact_cb (TpConnection *connection,
- EmpathyContact *contact,
- const GError *error,
- gpointer user_data,
- GObject *object)
+display_invite_room_dialog (EventManagerApproval *approval)
{
- EventManagerApproval *approval = (EventManagerApproval *) user_data;
GtkWidget *window = empathy_main_window_dup ();
const gchar *invite_msg;
gchar *msg;
TpHandle self_handle;
- if (error != NULL)
- {
- /* FIXME: We should probably still display the event */
- DEBUG ("Error: %s", error->message);
- return;
- }
-
- approval->contact = g_object_ref (contact);
-
self_handle = tp_channel_group_get_self_handle (approval->main_channel);
tp_channel_group_get_local_pending_info (approval->main_channel, self_handle,
NULL, NULL, &invite_msg);
- msg = g_strdup_printf (_("%s invited you to join %s"),
- empathy_contact_get_alias (approval->contact),
- tp_channel_get_identifier (approval->main_channel));
+ if (approval->contact != NULL)
+ {
+ msg = g_strdup_printf (_("%s invited you to join %s"),
+ empathy_contact_get_alias (approval->contact),
+ tp_channel_get_identifier (approval->main_channel));
+ }
+ else
+ {
+ msg = g_strdup_printf (_("You have been invited to join %s"),
+ tp_channel_get_identifier (approval->main_channel));
+ }
event_manager_add (approval->manager, approval->contact,
EMPATHY_EVENT_TYPE_INVITATION, EMPATHY_IMAGE_GROUP_MESSAGE, msg,
@@ -770,6 +761,27 @@ event_manager_muc_invite_got_contact_cb (TpConnection *connection,
}
static void
+event_manager_muc_invite_got_contact_cb (TpConnection *connection,
+ EmpathyContact *contact,
+ const GError *error,
+ gpointer user_data,
+ GObject *object)
+{
+ EventManagerApproval *approval = (EventManagerApproval *) user_data;
+
+ if (error != NULL)
+ {
+ DEBUG ("Error: %s", error->message);
+ }
+ else
+ {
+ approval->contact = g_object_ref (contact);
+ }
+
+ display_invite_room_dialog (approval);
+}
+
+static void
event_manager_ft_got_contact_cb (TpConnection *connection,
EmpathyContact *contact,
const GError *error,
@@ -878,9 +890,16 @@ approve_channels (TpSimpleApprover *approver,
DEBUG ("Have been invited to %s. Ask user if he wants to accept",
tp_channel_get_identifier (channel));
- empathy_tp_contact_factory_get_from_handle (connection,
- inviter, event_manager_muc_invite_got_contact_cb,
- approval, NULL, G_OBJECT (self));
+ if (inviter != 0)
+ {
+ empathy_tp_contact_factory_get_from_handle (connection,
+ inviter, event_manager_muc_invite_got_contact_cb,
+ approval, NULL, G_OBJECT (self));
+ }
+ else
+ {
+ display_invite_room_dialog (approval);
+ }
goto out;
}
diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c
index cf767a3ea..acf5eab21 100644
--- a/src/empathy-preferences.c
+++ b/src/empathy-preferences.c
@@ -60,6 +60,7 @@ struct _EmpathyPreferencesPriv {
GtkWidget *checkbutton_separate_chat_windows;
GtkWidget *checkbutton_events_notif_area;
GtkWidget *checkbutton_autoconnect;
+ GtkWidget *checkbutton_logging;
GtkWidget *checkbutton_sounds_enabled;
GtkWidget *checkbutton_sounds_disabled_away;
@@ -85,6 +86,7 @@ struct _EmpathyPreferencesPriv {
GSettings *gsettings_notify;
GSettings *gsettings_sound;
GSettings *gsettings_ui;
+ GSettings *gsettings_logger;
};
static void preferences_setup_widgets (EmpathyPreferences *preferences);
@@ -294,6 +296,12 @@ preferences_setup_widgets (EmpathyPreferences *preferences)
priv->checkbutton_location_reduce_accuracy,
"sensitive",
G_SETTINGS_BIND_GET);
+
+ g_settings_bind (priv->gsettings_logger,
+ EMPATHY_PREFS_LOGGER_ENABLED,
+ priv->checkbutton_logging,
+ "active",
+ G_SETTINGS_BIND_DEFAULT);
}
static void
@@ -837,6 +845,7 @@ empathy_preferences_finalize (GObject *self)
g_object_unref (priv->gsettings_notify);
g_object_unref (priv->gsettings_sound);
g_object_unref (priv->gsettings_ui);
+ g_object_unref (priv->gsettings_logger);
G_OBJECT_CLASS (empathy_preferences_parent_class)->finalize (self);
}
@@ -886,6 +895,7 @@ empathy_preferences_init (EmpathyPreferences *preferences)
"checkbutton_separate_chat_windows", &priv->checkbutton_separate_chat_windows,
"checkbutton_events_notif_area", &priv->checkbutton_events_notif_area,
"checkbutton_autoconnect", &priv->checkbutton_autoconnect,
+ "checkbutton_logging", &priv->checkbutton_logging,
"checkbutton_notifications_enabled", &priv->checkbutton_notifications_enabled,
"checkbutton_notifications_disabled_away", &priv->checkbutton_notifications_disabled_away,
"checkbutton_notifications_focus", &priv->checkbutton_notifications_focus,
@@ -914,6 +924,7 @@ empathy_preferences_init (EmpathyPreferences *preferences)
priv->gsettings_notify = g_settings_new (EMPATHY_PREFS_NOTIFICATIONS_SCHEMA);
priv->gsettings_sound = g_settings_new (EMPATHY_PREFS_SOUNDS_SCHEMA);
priv->gsettings_ui = g_settings_new (EMPATHY_PREFS_UI_SCHEMA);
+ priv->gsettings_logger = g_settings_new (EMPATHY_PREFS_LOGGER_SCHEMA);
preferences_themes_setup (preferences);
diff --git a/src/empathy-preferences.ui b/src/empathy-preferences.ui
index 0871d9412..d22166320 100644
--- a/src/empathy-preferences.ui
+++ b/src/empathy-preferences.ui
@@ -133,6 +133,20 @@
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_logging">
+ <property name="label" translatable="yes">Log conversations</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/src/empathy-sidebar.c b/src/empathy-sidebar.c
index 58f5d952c..8c979213c 100644
--- a/src/empathy-sidebar.c
+++ b/src/empathy-sidebar.c
@@ -415,7 +415,7 @@ empathy_sidebar_init (EmpathySidebar *sidebar)
select_hbox = gtk_hbox_new (FALSE, 0);
- sidebar->priv->label = gtk_label_new ("");
+ sidebar->priv->label = gtk_label_new (NULL);
gtk_box_pack_start (GTK_BOX (select_hbox),
sidebar->priv->label,
diff --git a/src/empathy.c b/src/empathy.c
index fc780fac0..0128b7b00 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -301,7 +301,7 @@ account_status_changed_cb (TpAccount *account,
return;
empathy_dispatcher_join_muc (account,
- empathy_chatroom_get_room (room), EMPATHY_DISPATCHER_NON_USER_ACTION);
+ empathy_chatroom_get_room (room), TP_USER_ACTION_TIME_NOT_USER_ACTION);
}
static void
@@ -350,7 +350,7 @@ account_manager_chatroom_ready_cb (GObject *source_object,
{
empathy_dispatcher_join_muc (account,
empathy_chatroom_get_room (room),
- EMPATHY_DISPATCHER_NON_USER_ACTION);
+ TP_USER_ACTION_TIME_NOT_USER_ACTION);
}
}