Commit c08d2960 authored by Emmanuel Lepage's avatar Emmanuel Lepage
Browse files

[ #13333] Display right IM tab label

parent fe46d894
......@@ -163,7 +163,7 @@ incoming_message_cb(DBusGProxy *proxy UNUSED, const gchar *callID UNUSED,
if (call) {
widget = &call->_im_widget;
id = call->_callID;
new_text_message(call->_callID,msg);
new_text_message(call,msg);
} else {
conference_obj_t *conf = conferencelist_get(current_calls_tab, callID);
if (!conf) {
......@@ -173,7 +173,7 @@ incoming_message_cb(DBusGProxy *proxy UNUSED, const gchar *callID UNUSED,
widget = &conf->_im_widget;
id = conf->_confID;
new_text_message(conf->_confID,msg);
new_text_message(conf,msg);
}
if (!*widget)
......
......@@ -32,13 +32,8 @@
#include "../dbus/dbus.h"
#include <string.h>
// void add_message_box(ClutterActor* stage, const char* author, const char* message)
// {
//
// }
static GtkWidget *tab_box = NULL;
static GHashTable *tabs = NULL;
static GHashTable *tabs = NULL;
GtkWidget *get_tab_box()
{
......@@ -95,10 +90,10 @@ static gboolean on_enter(GtkEntry *entry, gpointer user_data)
gtk_entry_set_text(entry,"");
}
message_tab* create_messaging_tab(const char* call_id,const char* title)
//conference_obj_t
message_tab* create_messaging_tab(callable_obj_t* call,const char* title)
{
message_tab *tab = g_hash_table_lookup(tabs,call_id);
message_tab *tab = g_hash_table_lookup(tabs,call->_callID);
if (tab) {
return tab;
......@@ -124,13 +119,20 @@ message_tab* create_messaging_tab(const char* call_id,const char* title)
g_signal_connect(G_OBJECT(line_edit), "activate", G_CALLBACK(on_enter), self);
self->widget = vbox;
self->call_id = call_id;
self->call_id = call->_callID;
self->title = title;
self->buffer = text_buffer;
self->entry = line_edit;
self->view = text_box_widget;
int ret = gtk_notebook_append_page(GTK_NOTEBOOK(get_tab_box()),vbox,NULL);
GtkWidget *tab_label = gtk_label_new(call->_peer_number);
gchar* label_text;
if (strcmp(call->_display_name,""))
label_text = call->_display_name;
else
label_text = call->_peer_number;
int ret = gtk_notebook_append_page(GTK_NOTEBOOK(get_tab_box()),vbox,tab_label);
gtk_widget_show (vbox);
gtk_widget_show (scoll_area);
gtk_widget_show (text_box_widget);
......@@ -139,7 +141,7 @@ message_tab* create_messaging_tab(const char* call_id,const char* title)
if (!tabs) {
tabs = g_hash_table_new(NULL,g_str_equal);
}
g_hash_table_insert(tabs,(gpointer)call_id,(gpointer)self);
g_hash_table_insert(tabs,(gpointer)call->_callID,(gpointer)self);
return self;
}
......@@ -36,6 +36,7 @@
#define __MESSAGING_H__
#include <gtk/gtk.h>
#include <callable_obj.h>
typedef struct {
GtkWidget *widget;
......@@ -47,7 +48,7 @@ typedef struct {
} message_tab;
// void add_message_box(ClutterActor* stage, const char* author, const char* message);
message_tab* create_messaging_tab(const char* call_id,const char* title);
message_tab* create_messaging_tab(callable_obj_t* call,const char* title);
GtkWidget *get_tab_box();
void new_text_message(gchar* call_id, char* message);
......
......@@ -652,14 +652,14 @@ call_im(void* foo UNUSED)
if (selectedCall) {
if (!selectedCall->_im_widget)
selectedCall->_im_widget = im_widget_display(selectedCall->_callID);
create_messaging_tab(selectedCall->_callID,"test");
create_messaging_tab(selectedCall,"test");
} else
WARN("Sorry. Instant messaging is not allowed outside a call\n");
} else {
if (selectedConf) {
if (!selectedConf->_im_widget)
selectedConf->_im_widget = im_widget_display(selectedConf->_confID);
create_messaging_tab(selectedConf->_confID,"test");
create_messaging_tab(selectedConf,"test");
} else
WARN("Sorry. Instant messaging is not allowed outside a call\n");
}
......
Supports Markdown
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