Commit 55d24730 authored by Hugo Lefeuvre's avatar Hugo Lefeuvre Committed by Sébastien Blin

fix memory leaks, hazardous frees and misc issues

accountgeneraltab:
+ remove useless <iostream> import

accountmigrationview:
+ remove useless <iostream> import
+ add missing <memory> import

currentcallview:
+ remove useless <iostream> import
+ add missing <memory> and <string> import
+ use g_debug instead of std::cout (not the standard debug output)

ringmainwindow:
+ fix multiple memory leaks in print_account_and_state(),
  on_clear_all_history_foreach() and changeAccountSelection()
+ fix use of deprecated method gtk_entry_set_icon_from_stock()
+ use G_GNUC_UNUSED to remove unused parameter warnings
+ remove various unused variables
+ remove unused function on_save_accounts_timeout()
+ fix multiple places where char* was passed to printf-style function
  with %i formatter

ringwelcomeview:
+ fix multiple memory leaks in ring_welcome_update_view() and
  render_account_avatar()
+ return FALSE in case of failure in draw_qrcode()

webkitchatcontainer:
+ webkit_chat_container_execute_js should take const char*, not char*
+ return true in case of success in webview_chat_context_menu()

usernameregistrationbox:
+ make "Enter the password of your Ring account" string translatable

ring_client:
+ fix multiple memory leaks in ring_client_open()

ring_notify:
+ improve ring_hide_notification() return values
+ fix multiple potential hazardous free() calls

video_widget:
+ fix leak in case of error in video_widget_on_drag_data_received()
+ fix hazardous free() call in switch_video_input_file() (uri might be
  NULL even if the answer of the dialog is GTK_RESPONSE_ACCEPT)

Change-Id: I7db8b63ba1b8ad272d464d0739b2fe24cc18c0b4
Gitlab: #917
Gitlab: #821Reviewed-by: Sébastien Blin's avatarSebastien Blin <sebastien.blin@savoirfairelinux.com>
parent 8df7e775
......@@ -28,7 +28,6 @@
#include "utils/models.h"
#include "usernameregistrationbox.h"
#include <iostream>
#include <api/newdevicemodel.h>
#include <api/newaccountmodel.h>
......
......@@ -26,7 +26,8 @@
// Qt
#include <QSize>
#include <iostream>
// std
#include <memory> // for std::shared_ptr
// LRC
#include <api/newaccountmodel.h>
......@@ -205,8 +206,9 @@ build_migration_view(AccountMigrationView *view)
g_signal_connect_swapped(priv->entry_password, "activate", G_CALLBACK(migrate), view);
gtk_label_set_text(GTK_LABEL(priv->label_account_alias), (*priv->accountInfo_)->profileInfo.alias.c_str());
// display the ringID (without "ring:")
std::cout << "MIGRATE FOR " << (*priv->accountInfo_)->id << std::endl;
g_debug("MIGRATE FOR %s", (*priv->accountInfo_)->id.c_str());
std::string username = (*priv->accountInfo_)->profileInfo.uri;
if (username.empty()) {
username = (*priv->accountInfo_)->profileInfo.uri;
......
......@@ -42,7 +42,9 @@
#include "utils/files.h"
#include "video/video_widget.h"
#include <iostream>
// std
#include <memory> // for std::shared_ptr
#include <string>
namespace { namespace details
{
......
......@@ -861,19 +861,19 @@ show_change_password_dialog(GtkListBox*, GtkListBoxRow *row, NewAccountSettingsV
gtk_entry_set_placeholder_text(GTK_ENTRY(priv->entry_current_password), _("Current password"));
gtk_entry_set_input_purpose(GTK_ENTRY(priv->entry_current_password), GTK_INPUT_PURPOSE_PASSWORD);
gtk_entry_set_visibility(GTK_ENTRY(priv->entry_current_password), 0);
gtk_entry_set_icon_from_stock(GTK_ENTRY(priv->entry_current_password), GTK_ENTRY_ICON_PRIMARY, "gtk-dialog-authentication");
gtk_entry_set_icon_from_icon_name(GTK_ENTRY(priv->entry_current_password), GTK_ENTRY_ICON_PRIMARY, "gtk-dialog-authentication");
gtk_container_add(GTK_CONTAINER(priv->vbox_change_password), priv->entry_current_password);
priv->entry_new_password = gtk_entry_new();
gtk_entry_set_placeholder_text(GTK_ENTRY(priv->entry_new_password), _("New password"));
gtk_entry_set_visibility(GTK_ENTRY(priv->entry_new_password), 0);
gtk_entry_set_input_purpose(GTK_ENTRY(priv->entry_new_password), GTK_INPUT_PURPOSE_PASSWORD);
gtk_entry_set_icon_from_stock(GTK_ENTRY(priv->entry_new_password), GTK_ENTRY_ICON_PRIMARY, "gtk-dialog-authentication");
gtk_entry_set_icon_from_icon_name(GTK_ENTRY(priv->entry_new_password), GTK_ENTRY_ICON_PRIMARY, "gtk-dialog-authentication");
gtk_container_add(GTK_CONTAINER(priv->vbox_change_password), priv->entry_new_password);
priv->entry_confirm_password = gtk_entry_new();
gtk_entry_set_placeholder_text(GTK_ENTRY(priv->entry_confirm_password), _("Confirm password"));
gtk_entry_set_visibility(GTK_ENTRY(priv->entry_confirm_password), 0);
gtk_entry_set_input_purpose(GTK_ENTRY(priv->entry_confirm_password), GTK_INPUT_PURPOSE_PASSWORD);
gtk_entry_set_icon_from_stock(GTK_ENTRY(priv->entry_confirm_password), GTK_ENTRY_ICON_PRIMARY, "gtk-dialog-authentication");
gtk_entry_set_icon_from_icon_name(GTK_ENTRY(priv->entry_confirm_password), GTK_ENTRY_ICON_PRIMARY, "gtk-dialog-authentication");
gtk_container_add(GTK_CONTAINER(priv->vbox_change_password), priv->entry_confirm_password);
auto* buttons = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
priv->button_validate_password = gtk_button_new();
......
......@@ -378,8 +378,9 @@ ring_client_open(GApplication *app, GFile **file, gint /*arg3*/, const gchar* /*
{
ring_client_activate(app);
if (strcmp(g_file_get_uri_scheme(*file), "ring") == 0) {
const char * call_id = g_file_get_basename(*file);
gchar *file_uri_scheme = g_file_get_uri_scheme(*file);
if (strcmp(file_uri_scheme, "ring") == 0) {
char * call_id = g_file_get_basename(*file);
std::regex format {"^[[:xdigit:]]{40}$"};
if (std::regex_match(call_id, format)) {
......@@ -389,7 +390,11 @@ ring_client_open(GApplication *app, GFile **file, gint /*arg3*/, const gchar* /*
place_new_call(cm.get());
cm.release();
}
g_free(call_id);
}
g_free(file_uri_scheme);
}
#if USE_LIBNM
......
......@@ -44,7 +44,6 @@
#include <media/recordingmodel.h>
#include <media/text.h>
// Ring client
#include "newaccountsettingsview.h"
#include "accountmigrationview.h"
......@@ -150,11 +149,11 @@ inline namespace helpers
* set the column value by printing the alias and the state of an account in combobox_account_selector.
*/
static void
print_account_and_state(GtkCellLayout* cell_layout,
print_account_and_state(G_GNUC_UNUSED GtkCellLayout* cell_layout,
GtkCellRenderer* cell,
GtkTreeModel* model,
GtkTreeIter* iter,
gpointer* data)
G_GNUC_UNUSED gpointer* data)
{
gchar *id;
gchar *alias;
......@@ -203,15 +202,20 @@ print_account_and_state(GtkCellLayout* cell_layout,
g_object_set(G_OBJECT(cell), "markup", text, NULL);
g_object_set(G_OBJECT(cell), "height", 17, NULL);
g_object_set(G_OBJECT(cell), "ypad", 0, NULL);
g_free(id);
g_free(alias);
g_free(registeredName);
g_free(uri);
g_free(text);
}
static void
render_account_avatar(GtkCellLayout* cell_layout,
render_account_avatar(G_GNUC_UNUSED GtkCellLayout* cell_layout,
GtkCellRenderer *cell,
GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data)
G_GNUC_UNUSED gpointer data)
{
gchar *id;
gchar* avatar;
......@@ -223,11 +227,11 @@ render_account_avatar(GtkCellLayout* cell_layout,
2 /* col# */, &avatar /* data */,
-1);
bool enabled = g_strcmp0("true", enabledStr) == 0;
if (g_strcmp0("", id) == 0) {
g_free(enabledStr);
g_free(avatar);
g_free(id);
GdkPixbuf* icon = gdk_pixbuf_new_from_resource("/cx/ring/RingGnome/add-device", nullptr);
g_object_set(G_OBJECT(cell), "width", 32, nullptr);
g_object_set(G_OBJECT(cell), "height", 32, nullptr);
......@@ -235,9 +239,11 @@ render_account_avatar(GtkCellLayout* cell_layout,
return;
}
bool enabled = g_strcmp0("true", enabledStr) == 0;
auto default_avatar = Interfaces::PixbufManipulator().generateAvatar("", "");
auto default_scaled = Interfaces::PixbufManipulator().scaleAndFrame(default_avatar.get(), QSize(32, 32), true, enabled);
auto photo = default_scaled;
std::string photostr = avatar;
if (!photostr.empty()) {
QByteArray byteArray(photostr.c_str(), photostr.length());
......@@ -254,6 +260,7 @@ render_account_avatar(GtkCellLayout* cell_layout,
g_free(enabledStr);
g_free(avatar);
g_free(id);
}
inline static void
......@@ -367,18 +374,6 @@ private:
inline namespace gtk_callbacks
{
static gboolean
on_save_accounts_timeout(GtkWidget* working_dialog)
{
/* save changes to accounts */
AccountModel::instance().save();
if (working_dialog)
gtk_widget_destroy(working_dialog);
return G_SOURCE_REMOVE;
}
static void
on_video_double_clicked(RingMainWindow* self)
{
......@@ -600,7 +595,7 @@ on_dtmf_pressed(RingMainWindow* self, GdkEventKey* event, gpointer user_data)
// the daemon will filter out invalid DTMF characters
guint32 unicode_val = gdk_keyval_to_unicode(event->keyval);
QString val = QString::fromUcs4(&unicode_val, 1);
g_debug("attemptingto play DTMF tone during ongoing call: %s", val.toUtf8().constData());
g_debug("attempting to play DTMF tone during ongoing call: %s", val.toUtf8().constData());
priv->cpp->accountInfo_->callModel->playDTMF(current_item.callId, val.toStdString());
// always propagate the key, so we don't steal accelerators/shortcuts
return GDK_EVENT_PROPAGATE;
......@@ -740,7 +735,6 @@ action_notification(gchar* title, RingMainWindow* self, Action action)
conversations_view_select_conversation(CONVERSATIONS_VIEW(priv->treeview_conversations), information);
} else if (type == "request") {
for (const auto& conversation : priv->cpp->accountInfo_->conversationModel->getFilteredConversations(lrc::api::profile::Type::PENDING)) {
auto current_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(priv->notebook_contacts));
auto contactRequestsPageNum = gtk_notebook_page_num(GTK_NOTEBOOK(priv->notebook_contacts),
priv->scrolled_window_contact_requests);
gtk_notebook_set_current_page(GTK_NOTEBOOK(priv->notebook_contacts), contactRequestsPageNum);
......@@ -764,14 +758,15 @@ action_notification(gchar* title, RingMainWindow* self, Action action)
}
}
} catch (const std::out_of_range& e) {
g_warning("Can't get account %i: %s", id.c_str(), e.what());
g_warning("Can't get account %s: %s", id.c_str(), e.what());
}
}
}
static void
on_notification_chat_clicked(GtkWidget* notifier, gchar *title, RingMainWindow* self)
on_notification_chat_clicked(G_GNUC_UNUSED GtkWidget* notifier,
gchar *title, RingMainWindow* self)
{
action_notification(title, self, Action::SELECT);
}
......@@ -789,7 +784,8 @@ on_notification_refuse_pending(GtkWidget*, gchar *title, RingMainWindow* self)
}
static void
on_notification_accept_call(GtkWidget* notifier, gchar *title, RingMainWindow* self)
on_notification_accept_call(G_GNUC_UNUSED GtkWidget* notifier,
gchar *title, RingMainWindow* self)
{
g_return_if_fail(IS_RING_MAIN_WINDOW(self) && title);
auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self));
......@@ -816,12 +812,12 @@ on_notification_accept_call(GtkWidget* notifier, gchar *title, RingMainWindow* s
auto& accountInfo = priv->cpp->lrc_->getAccountModel().getAccountInfo(id);
accountInfo.callModel->accept(information);
} catch (const std::out_of_range& e) {
g_warning("Can't get account %i: %s", id.c_str(), e.what());
g_warning("Can't get account %s: %s", id.c_str(), e.what());
}
}
static void
on_notification_decline_call(GtkWidget* notifier, gchar *title, RingMainWindow* self)
on_notification_decline_call(G_GNUC_UNUSED GtkWidget* notifier, gchar *title, RingMainWindow* self)
{
g_return_if_fail(IS_RING_MAIN_WINDOW(self) && title);
auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self));
......@@ -844,7 +840,7 @@ on_notification_decline_call(GtkWidget* notifier, gchar *title, RingMainWindow*
auto& accountInfo = priv->cpp->lrc_->getAccountModel().getAccountInfo(id);
accountInfo.callModel->hangUp(information);
} catch (const std::out_of_range& e) {
g_warning("Can't get account %i: %s", id.c_str(), e.what());
g_warning("Can't get account %s: %s", id.c_str(), e.what());
}
}
......@@ -857,18 +853,19 @@ CppImpl::CppImpl(RingMainWindow& widget)
{}
static gboolean
on_clear_all_history_foreach(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer self)
on_clear_all_history_foreach(GtkTreeModel *model, G_GNUC_UNUSED GtkTreePath *path, GtkTreeIter *iter, gpointer self)
{
g_return_val_if_fail(IS_RING_MAIN_WINDOW(self), TRUE);
auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self));
const gchar* account_id;
gchar* account_id;
gtk_tree_model_get(model, iter, 0 /* col# */, &account_id /* data */, -1);
auto& accountInfo = priv->cpp->lrc_->getAccountModel().getAccountInfo(account_id);
accountInfo.conversationModel->clearAllHistory();
g_free(account_id);
return FALSE;
}
......@@ -1082,9 +1079,6 @@ CppImpl::init()
refreshAccountSelectorWidget(0);
/* layout */
auto* model = gtk_combo_box_get_model(GTK_COMBO_BOX(widgets->combobox_account_selector));
auto* renderer = gtk_cell_renderer_pixbuf_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(widgets->combobox_account_selector), renderer, true);
gtk_cell_layout_set_cell_data_func(GTK_CELL_LAYOUT(widgets->combobox_account_selector),
......@@ -1448,13 +1442,15 @@ CppImpl::changeAccountSelection(const std::string& id)
GtkTreeIter iter;
auto valid = gtk_tree_model_get_iter_first(model, &iter);
while (valid) {
const gchar* account_id;
gchar* account_id;
gtk_tree_model_get(model, &iter, 0 /* col# */, &account_id /* data */, -1);
if (id == account_id) {
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(widgets->combobox_account_selector), &iter);
g_free(account_id);
return;
}
valid = gtk_tree_model_iter_next(model, &iter);
g_free(account_id);
}
g_debug("BUGS: account not listed: %s", id.c_str());
......@@ -1787,7 +1783,6 @@ CppImpl::slotCallStatusChanged(const std::string& callId)
if (accountInfo_->profileInfo.type == lrc::api::profile::Type::RING && peer.find("ring:") == 0) {
peer = peer.substr(5);
}
auto& contactModel = accountInfo_->contactModel;
std::string notifId = "";
try {
notifId = accountInfo_->id + ":call:" + callId;
......
......@@ -45,28 +45,6 @@
static constexpr const char* SERVER_NOTIFY_OSD = "notify-osd";
static constexpr const char* NOTIFICATION_FILE = SOUNDSDIR "/ringtone_notify.wav";
/* struct to store the parsed list of the notify server capabilities */
struct RingNotifyServerInfo
{
/* info */
char *name;
char *vendor;
char *version;
char *spec;
/* capabilities */
gboolean append;
gboolean actions;
/* the info strings must be freed */
~RingNotifyServerInfo() {
g_free(name);
g_free(vendor);
g_free(version);
g_free(spec);
}
};
namespace details
{
class CppImpl;
......@@ -86,8 +64,6 @@ typedef struct _RingNotifierPrivate RingNotifierPrivate;
struct _RingNotifierPrivate
{
RingNotifyServerInfo serverInfo;
details::CppImpl* cpp; ///< Non-UI and C++ only code0
};
......@@ -119,23 +95,40 @@ public:
RingNotifier* self = nullptr; // The GTK widget itself
RingNotifierPrivate* priv = nullptr;
/* server info and capabilities */
char *name = nullptr;
char *vendor = nullptr;
char *version = nullptr;
char *spec = nullptr;
gboolean append;
gboolean actions;
std::map<std::string, std::shared_ptr<NotifyNotification>> notifications_;
private:
CppImpl() = delete;
CppImpl(const CppImpl&) = delete;
CppImpl& operator=(const CppImpl&) = delete;
};
CppImpl::CppImpl(RingNotifier& widget)
: self {&widget}
{}
: self {&widget}
{
}
CppImpl::~CppImpl()
{}
{
if (name)
g_free(name);
if (vendor)
g_free(vendor);
if (version)
g_free(version);
if (spec)
g_free(spec);
}
} // namespace details
static void
ring_notifier_dispose(GObject *object)
{
......@@ -165,12 +158,12 @@ ring_notifier_init(RingNotifier *view)
notify_init("Ring");
/* get notify server info */
if (notify_get_server_info(&(priv->serverInfo).name,
&(priv->serverInfo).vendor,
&(priv->serverInfo).version,
&(priv->serverInfo).spec)) {
if (notify_get_server_info(&priv->cpp->name,
&priv->cpp->vendor,
&priv->cpp->version,
&priv->cpp->spec)) {
g_debug("notify server name: %s, vendor: %s, version: %s, spec: %s",
priv->serverInfo.name, priv->serverInfo.vendor, priv->serverInfo.version, priv->serverInfo.spec);
priv->cpp->name, priv->cpp->vendor, priv->cpp->version, priv->cpp->spec);
}
/* check notify server capabilities */
......@@ -178,10 +171,10 @@ ring_notifier_init(RingNotifier *view)
while (list) {
if (g_strcmp0((const char *)list->data, "append") == 0 ||
g_strcmp0((const char *)list->data, "x-canonical-append") == 0) {
priv->serverInfo.append = TRUE;
priv->cpp->append = TRUE;
}
if (g_strcmp0((const char *)list->data, "actions") == 0) {
priv->serverInfo.actions = TRUE;
priv->cpp->actions = TRUE;
}
list = g_list_next(list);
......@@ -340,7 +333,7 @@ ring_show_notification(RingNotifier* view, const std::string& icon,
#endif // USE_CANBERRA
// if the notification server supports actions, make the default action to show the chat view
if (priv->serverInfo.actions) {
if (priv->cpp->actions) {
if (type != NotificationType::CALL) {
notify_notification_add_action(notification.get(),
id.c_str(),
......@@ -397,23 +390,26 @@ gboolean
ring_hide_notification(RingNotifier* view, const std::string& id)
{
g_return_val_if_fail(IS_RING_NOTIFIER(view), false);
gboolean success = FALSE;
RingNotifierPrivate *priv = RING_NOTIFIER_GET_PRIVATE(view);
#if USE_LIBNOTIFY
// Search
auto notification = priv->cpp->notifications_.find(id);
if (notification == priv->cpp->notifications_.end()) {
return success;
return FALSE;
}
// Close
GError *error = nullptr;
if (!notify_notification_close(notification->second.get(), &error)) {
g_warning("could not close notification: %s", error->message);
g_clear_error(&error);
return FALSE;
}
// Erase
priv->cpp->notifications_.erase(id);
#endif
return success;
return TRUE;
}
......@@ -96,7 +96,7 @@ ring_welcome_update_view(RingWelcomeView* self) {
(*priv->accountInfo_)->profileInfo.uri.c_str());
} else {
gtk_label_set_text(GTK_LABEL(priv->label_explanation), NULL);
ring_id = {};
ring_id = g_strdup("");
}
gtk_label_set_markup(GTK_LABEL(priv->label_ringid), ring_id);
......@@ -105,6 +105,8 @@ ring_welcome_update_view(RingWelcomeView* self) {
gtk_widget_show(priv->label_ringid);
gtk_widget_show(priv->button_qrcode);
gtk_widget_show(priv->revealer_qrcode);
g_free(ring_id);
}
static void
......@@ -255,7 +257,7 @@ draw_qrcode(G_GNUC_UNUSED GtkWidget* diese,
if (!rcode) { // no rcode, no draw
g_warning("Failed to generate QR code");
return TRUE;
return FALSE;
}
auto margin = 5;
......@@ -286,7 +288,6 @@ draw_qrcode(G_GNUC_UNUSED GtkWidget* diese,
QRcode_free(rcode);
return TRUE;
}
static void
......
......@@ -310,7 +310,7 @@ button_register_username_clicked(G_GNUC_UNUSED GtkButton* button, UsernameRegist
(GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_OK_CANCEL,
"Enter the password of your Ring account"
_("Enter the password of your Ring account")
);
GtkWidget* entry_password = gtk_entry_new();
......
......@@ -400,7 +400,10 @@ void video_widget_on_drag_data_received(G_GNUC_UNUSED GtkWidget *self,
}
}
if (!call) return;
if (!call) {
g_strfreev(uris);
return;
}
if (uris && *uris){
if (auto out_media = call->firstMedia<media::Video>(media::Media::Direction::OUT))
......@@ -413,7 +416,7 @@ void video_widget_on_drag_data_received(G_GNUC_UNUSED GtkWidget *self,
static void
switch_video_input(GtkWidget *widget, Video::Device *device)
{
gpointer data = g_object_get_data(G_OBJECT(widget),JOIN_CALL_KEY );
gpointer data = g_object_get_data(G_OBJECT(widget), JOIN_CALL_KEY);
g_return_if_fail(data);
Call *call = (Call*)data;
......@@ -491,7 +494,6 @@ switch_video_input_file(GtkWidget *item, GtkWidget *parent)
parent = gtk_widget_get_toplevel(GTK_WIDGET(parent));
}
gchar *uri = NULL;
GtkWidget *dialog = gtk_file_chooser_dialog_new(
"Choose File",
GTK_WINDOW(parent),
......@@ -509,16 +511,21 @@ switch_video_input_file(GtkWidget *item, GtkWidget *parent)
}
}
if (!call) return;
if (!call) {
gtk_widget_destroy(dialog);
return;
}
uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog));
gchar *uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog));
if (auto out_media = call->firstMedia<media::Video>(media::Media::Direction::OUT))
out_media->sourceModel()->setFile(QUrl(uri));
if (uri) {
if (auto out_media = call->firstMedia<media::Video>(media::Media::Direction::OUT))
out_media->sourceModel()->setFile(QUrl(uri));
g_free(uri);
}
}
gtk_widget_destroy(dialog);
g_free(uri);
}
/*
......
......@@ -151,11 +151,12 @@ webview_chat_context_menu(G_GNUC_UNUSED WebKitChatContainer *self,
webkit_context_menu_remove(menu, item);
}
}
return false;
return true;
}
static void
webkit_chat_container_execute_js(WebKitChatContainer *view, gchar* function_call)
webkit_chat_container_execute_js(WebKitChatContainer *view, const gchar* function_call)
{
WebKitChatContainerPrivate *priv = WEBKIT_CHAT_CONTAINER_GET_PRIVATE(view);
webkit_web_view_run_javascript(
......@@ -325,8 +326,6 @@ webview_chat_decide_policy (G_GNUC_UNUSED WebKitWebView *web_view,
}
case WEBKIT_POLICY_DECISION_TYPE_RESPONSE:
{
//WebKitResponsePolicyDecision *response = WEBKIT_RESPONSE_POLICY_DECISION (decision);
//break;
return FALSE;
}
default:
......@@ -614,15 +613,13 @@ webkit_chat_disable_send_interaction(WebKitChatContainer *view, bool isDisabled)
void
webkit_chat_container_clear_sender_images(WebKitChatContainer *view)
{
webkit_chat_container_execute_js(view, "clearSenderImages()");
webkit_chat_container_execute_js(view, "clearSenderImages();");
}
void
webkit_chat_container_clear(WebKitChatContainer *view)
{
WebKitChatContainerPrivate *priv = WEBKIT_CHAT_CONTAINER_GET_PRIVATE(view);
webkit_chat_container_execute_js(view, "clearMessages()");
webkit_chat_container_execute_js(view, "clearMessages();");
webkit_chat_container_clear_sender_images(view);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment