Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guido Gunther
pkg-chatty
Commits
82dccbbb
Commit
82dccbbb
authored
Sep 02, 2021
by
Evangelos Ribeiro Tzaras
Browse files
chatty Debian release 0.4.0~beta2-1
Merge tag 'debian/0.4.0_beta2-1' into rel_0.4.0_beta2
parents
2808453b
529ac579
Changes
75
Expand all
Hide whitespace changes
Inline
Side-by-side
data/sm.puri.Chatty.gschema.xml
View file @
82dccbbb
...
...
@@ -62,6 +62,12 @@
<description>
Whether pressing Enter key sends the message
</description>
</key>
<key
name=
"request-sms-delivery-reports"
type=
"b"
>
<default>
true
</default>
<summary>
Request SMS delivery reports
</summary>
<description>
Whether to request delivery reports for outgoing SMS
</description>
</key>
<key
name=
"experimental-features"
type=
"b"
>
<default>
false
</default>
<summary>
Enable experimental features
</summary>
...
...
debian/changelog
View file @
82dccbbb
chatty (0.4.0~beta2-1) experimental; urgency=medium
* New upstream version 0.4.0~beta2
* d/control: Add libgspell-1-dev build dependency
-- Evangelos Ribeiro Tzaras <devrtz-debian@fortysixandtwo.eu> Tue, 31 Aug 2021 23:30:07 +0200
chatty (0.3.4-2) unstable; urgency=medium
* ci: No need to use experimental anymore
* Upload to unstable
-- Evangelos Ribeiro Tzaras <devrtz-debian@fortysixandtwo.eu> Thu, 26 Aug 2021 17:47:00 +0200
chatty (0.3.4-1pureos1) byzantium; urgency=medium
* Upload to byzantium
...
...
debian/control
View file @
82dccbbb
...
...
@@ -16,9 +16,11 @@ Build-Depends:
libebook1.2-dev,
libfeedback-dev,
libgcrypt20-dev,
libgspell-1-dev,
libgtk-3-dev,
libhandy-1-dev (>= 1.1.90),
libjson-glib-dev,
libmm-glib-dev (>= 1.12.0),
libolm-dev,
libphonenumber-dev,
libpurple-dev,
...
...
debian/salsa-ci.yml
View file @
82dccbbb
...
...
@@ -5,9 +5,4 @@ include:
variables
:
SALSA_CI_DISABLE_BUILD_PACKAGE_ANY
:
1
RELEASE
:
'
experimental'
# Since those pull from unstable
SALSA_CI_DISABLE_REPROTEST
:
1
SALSA_CI_DISABLE_PIUPARTS
:
1
SALSA_CI_DISABLE_AUTOPKGTEST
:
1
meson.build
View file @
82dccbbb
project(
'chatty', 'c', 'cpp',
version: '0.
3.4
',
version: '0.
4.0.beta2
',
meson_version: '>= 0.46.0',
)
...
...
po/pt_BR.po
View file @
82dccbbb
This diff is collapsed.
Click to expand it.
po/ro.po
View file @
82dccbbb
This diff is collapsed.
Click to expand it.
sm.puri.Chatty.json
View file @
82dccbbb
...
...
@@ -9,7 +9,12 @@
"--share=ipc"
,
"--socket=fallback-x11"
,
"--socket=wayland"
,
"--talk-name=org.sigxcpu.Feedback"
"--talk-name=org.sigxcpu.Feedback"
,
"--system-talk-name=org.freedesktop.ModemManager1"
,
"--talk-name=org.gnome.evolution.dataserver.AddressBook10"
,
"--talk-name=org.gnome.evolution.dataserver.Sources5"
,
"--talk-name=im.pidgin.purple.PurpleService"
,
"--talk-name=org.gnome.evolution.dataserver.Subprocess.Backend.*"
],
"cleanup-commands"
:
[
"rm -rf /app/lib/debug/ /app/include/boost"
],
"cleanup"
:
[
...
...
@@ -169,9 +174,9 @@
"-DENABLE_UOA=OFF"
,
"-DENABLE_GOOGLE_AUTH=OFF"
,
"-DENABLE_GOOGLE=OFF"
,
"-DENABLE_WITH_PHONENUMBER=ON"
,
"-DENABLE_VALA_BINDINGS=ON"
,
"-DENABLE_WEATHER=OFF"
,
"-DWITH_PHONENUMBER=ON"
,
"-DWITH_OPENLDAP=OFF"
,
"-DWITH_LIBDB=OFF"
,
"-DENABLE_INTROSPECTION=ON"
,
...
...
@@ -207,10 +212,64 @@
"sources"
:
[
{
"type"
:
"git"
,
"tag"
:
"3.2.4"
,
"url"
:
"https://gitlab.matrix.org/matrix-org/olm.git"
}
]
},
{
"name"
:
"gspell"
,
"config-opts"
:
[
"--disable-gtk-doc"
,
"--disable-gtk-doc-html"
],
"cleanup"
:
[
"/bin"
,
"/include"
,
"/lib/pkgconfig"
,
"*.la"
,
"/share"
],
"sources"
:
[
{
"type"
:
"archive"
,
"url"
:
"https://download.gnome.org/sources/gspell/1.8/gspell-1.8.1.tar.xz"
,
"sha256"
:
"819a1d23c7603000e73f5e738bdd284342e0cd345fb0c7650999c31ec741bbe5"
}
]
},
{
"name"
:
"gudev"
,
"buildsystem"
:
"meson"
,
"config-opts"
:
[
"-Dtests=disabled"
,
"-Dintrospection=disabled"
],
"sources"
:
[
{
"type"
:
"git"
,
"url"
:
"https://gitlab.gnome.org/GNOME/libgudev.git"
}
]
},
{
"name"
:
"ModemManager"
,
"buildsystem"
:
"autotools"
,
"config-opts"
:
[
"--disable-introspection"
,
"--disable-vala"
,
"--with-udev-base-dir=/app/lib"
,
"--with-systemdsystemunitdir=/app/lib/systemd/system"
,
"--without-mbim"
,
"--without-qmi"
],
"sources"
:
[
{
"type"
:
"git"
,
"url"
:
"git://anongit.freedesktop.org/ModemManager/ModemManager"
}
]
},
{
"name"
:
"purism-chatty"
,
"buildsystem"
:
"meson"
,
...
...
src/chatty-application.c
View file @
82dccbbb
...
...
@@ -193,7 +193,7 @@ application_show_connection_error (ChattyApplication *self,
gtk_message_dialog_format_secondary_text
(
GTK_MESSAGE_DIALOG
(
dialog
),
"%s: %s
\n\n
%s"
,
message
,
chatty_
account
_get_username
(
CHATTY_
ACCOUNT
(
account
)),
chatty_
item
_get_username
(
CHATTY_
ITEM
(
account
)),
_
(
"Please check ID and password"
));
run_dialog_and_destroy
(
GTK_DIALOG
(
dialog
));
...
...
@@ -206,13 +206,8 @@ application_open_chat (ChattyApplication *self,
g_assert
(
CHATTY_IS_APPLICATION
(
self
));
g_assert
(
CHATTY_IS_CHAT
(
chat
));
if
(
!
self
->
main_window
)
{
self
->
main_window
=
chatty_window_new
(
GTK_APPLICATION
(
self
));
g_object_add_weak_pointer
(
G_OBJECT
(
self
->
main_window
),
(
gpointer
*
)
&
self
->
main_window
);
}
g_application_activate
(
G_APPLICATION
(
self
));
chatty_window_open_chat
(
CHATTY_WINDOW
(
self
->
main_window
),
chat
);
gtk_window_present
(
GTK_WINDOW
(
self
->
main_window
));
}
static
gboolean
...
...
@@ -237,8 +232,8 @@ chatty_application_show_window (GSimpleAction *action,
g_assert
(
CHATTY_IS_APPLICATION
(
self
));
self
->
show_window
=
TRUE
;
g_application_activate
(
G_APPLICATION
(
self
));
gtk_window_present
(
GTK_WINDOW
(
self
->
main_window
));
}
static
void
...
...
@@ -260,6 +255,8 @@ chatty_application_open_chat (GSimpleAction *action,
CHATTY_DEBUG_MSG
(
"Opening chat %s, account: %s"
,
room_id
,
account_id
);
self
->
show_window
=
TRUE
;
g_application_activate
(
G_APPLICATION
(
self
));
chatty_window_open_chat
(
CHATTY_WINDOW
(
self
->
main_window
),
chat
);
}
...
...
src/chatty-chat-view.c
View file @
82dccbbb
...
...
@@ -10,6 +10,7 @@
*/
#include
<glib/gi18n.h>
#include
<gspell/gspell.h>
#include
"chatty-avatar.h"
#include
"chatty-chat.h"
...
...
@@ -55,8 +56,6 @@ struct _ChattyChatView
gboolean
first_scroll_to_bottom
;
};
static
GHashTable
*
ht_sms_id
=
NULL
;
#define INDICATOR_WIDTH 60
#define INDICATOR_HEIGHT 40
#define INDICATOR_MARGIN 2
...
...
@@ -90,14 +89,6 @@ enum {
static
guint
signals
[
N_SIGNALS
];
static
gboolean
chat_view_hash_table_match_item
(
gpointer
key
,
gpointer
value
,
gpointer
user_data
)
{
return
value
==
user_data
;
}
static
void
chatty_draw_typing_indicator
(
cairo_t
*
cr
)
{
...
...
@@ -206,7 +197,7 @@ chatty_chat_view_update (ChattyChatView *self)
gtk_widget_set_visible
(
self
->
send_file_button
,
chatty_chat_has_file_upload
(
self
->
chat
));
if
(
protocol
==
CHATTY_PROTOCOL_SMS
)
{
if
(
protocol
==
CHATTY_PROTOCOL_
MMS_
SMS
)
{
gtk_label_set_label
(
GTK_LABEL
(
self
->
empty_label0
),
_
(
"This is an SMS conversation"
));
gtk_label_set_label
(
GTK_LABEL
(
self
->
empty_label1
),
...
...
@@ -225,7 +216,7 @@ chatty_chat_view_update (ChattyChatView *self)
context
=
gtk_widget_get_style_context
(
self
->
send_message_button
);
if
(
protocol
==
CHATTY_PROTOCOL_SMS
)
if
(
protocol
==
CHATTY_PROTOCOL_
MMS_
SMS
)
gtk_style_context_add_class
(
context
,
"button_send_green"
);
else
if
(
chatty_chat_is_im
(
self
->
chat
))
gtk_style_context_add_class
(
context
,
"suggested-action"
);
...
...
@@ -267,6 +258,21 @@ chat_view_edge_overshot_cb (ChattyChatView *self,
}
static
void
chat_account_status_changed_cb
(
ChattyChatView
*
self
)
{
ChattyAccount
*
account
;
gboolean
enabled
;
account
=
chatty_chat_get_account
(
self
->
chat
);
g_return_if_fail
(
account
);
enabled
=
chatty_account_get_status
(
account
)
==
CHATTY_CONNECTED
;
gtk_widget_set_sensitive
(
self
->
message_input
,
enabled
);
gtk_widget_set_sensitive
(
self
->
send_file_button
,
enabled
);
gtk_widget_set_sensitive
(
self
->
send_message_button
,
enabled
);
}
static
GtkWidget
*
chat_view_message_row_new
(
ChattyMessage
*
message
,
ChattyChatView
*
self
)
...
...
@@ -371,6 +377,16 @@ chat_view_send_file_button_clicked_cb (ChattyChatView *self,
}
}
static
void
view_send_message_async_cb
(
GObject
*
object
,
GAsyncResult
*
result
,
gpointer
user_data
)
{
g_autoptr
(
ChattyChatView
)
self
=
user_data
;
chatty_chat_set_unread_count
(
self
->
chat
,
0
);
}
static
void
chat_view_send_message_button_clicked_cb
(
ChattyChatView
*
self
)
{
...
...
@@ -379,8 +395,6 @@ chat_view_send_message_button_clicked_cb (ChattyChatView *self)
g_autoptr
(
ChattyMessage
)
msg
=
NULL
;
g_autofree
char
*
message
=
NULL
;
GtkTextIter
start
,
end
;
gchar
*
sms_id_str
;
guint
sms_id
;
g_assert
(
CHATTY_IS_CHAT_VIEW
(
self
));
...
...
@@ -413,24 +427,6 @@ chat_view_send_message_button_clicked_cb (ChattyChatView *self)
protocol
=
chatty_item_get_protocols
(
CHATTY_ITEM
(
self
->
chat
));
/* provide a msg-id to the sms-plugin for send-receipts */
if
(
conv
&&
chatty_item_get_protocols
(
CHATTY_ITEM
(
self
->
chat
))
==
CHATTY_PROTOCOL_SMS
)
{
sms_id
=
g_random_int
();
sms_id_str
=
g_strdup_printf
(
"%i"
,
sms_id
);
g_hash_table_insert
(
ht_sms_id
,
sms_id_str
,
g_object_ref
(
self
->
chat
));
g_debug
(
"hash table insert sms_id_str: %s ht_size: %i"
,
sms_id_str
,
g_hash_table_size
(
ht_sms_id
));
purple_conv_im_send_with_flags
(
PURPLE_CONV_IM
(
conv
),
sms_id_str
,
PURPLE_MESSAGE_NO_LOG
|
PURPLE_MESSAGE_NOTIFY
|
PURPLE_MESSAGE_INVISIBLE
);
}
if
(
protocol
==
CHATTY_PROTOCOL_MATRIX
||
protocol
==
CHATTY_PROTOCOL_XMPP
||
protocol
==
CHATTY_PROTOCOL_TELEGRAM
)
...
...
@@ -440,7 +436,9 @@ chat_view_send_message_button_clicked_cb (ChattyChatView *self)
NULL
,
time
(
NULL
),
escaped
?
CHATTY_MESSAGE_HTML_ESCAPED
:
CHATTY_MESSAGE_TEXT
,
CHATTY_DIRECTION_OUT
,
0
);
chatty_chat_send_message_async
(
self
->
chat
,
msg
,
NULL
,
NULL
);
chatty_chat_send_message_async
(
self
->
chat
,
msg
,
view_send_message_async_cb
,
g_object_ref
(
self
));
gtk_widget_hide
(
self
->
send_message_button
);
}
...
...
@@ -482,7 +480,7 @@ chat_view_message_input_changed_cb (ChattyChatView *self)
chatty_update_typing_status
(
self
);
if
(
chatty_settings_get_convert_emoticons
(
chatty_settings_get_default
())
&&
chatty_item_get_protocols
(
CHATTY_ITEM
(
self
->
chat
))
!=
CHATTY_PROTOCOL_SMS
)
chatty_item_get_protocols
(
CHATTY_ITEM
(
self
->
chat
))
!=
CHATTY_PROTOCOL_
MMS_
SMS
)
chatty_check_for_emoticon
(
self
);
}
...
...
@@ -595,56 +593,6 @@ chat_view_file_requested_cb (ChattyChatView *self,
g_object_ref
(
self
));
}
static
void
chat_view_sms_sent_cb
(
const
char
*
sms_id
,
int
status
)
{
ChattyChat
*
chat
;
ChattyMessage
*
message
;
GListModel
*
message_list
;
const
gchar
*
message_id
;
ChattyMsgStatus
sent_status
;
time_t
time_now
;
guint
n_items
;
if
(
sms_id
==
NULL
)
return
;
if
(
status
==
CHATTY_SMS_RECEIPT_NONE
)
sent_status
=
CHATTY_STATUS_SENDING_FAILED
;
else
if
(
status
==
CHATTY_SMS_RECEIPT_MM_ACKN
)
sent_status
=
CHATTY_STATUS_SENT
;
else
if
(
status
==
CHATTY_SMS_RECEIPT_SMSC_ACKN
)
sent_status
=
CHATTY_STATUS_DELIVERED
;
else
return
;
chat
=
g_hash_table_lookup
(
ht_sms_id
,
sms_id
);
if
(
!
chat
)
return
;
message_list
=
chatty_chat_get_messages
(
chat
);
n_items
=
g_list_model_get_n_items
(
message_list
);
message
=
g_list_model_get_item
(
message_list
,
n_items
-
1
);
message_id
=
chatty_message_get_id
(
message
);
time_now
=
time
(
NULL
);
if
(
message_id
==
NULL
)
chatty_message_set_id
(
message
,
sms_id
);
if
(
g_strcmp0
(
message_id
,
sms_id
)
==
0
)
{
chatty_message_set_status
(
message
,
sent_status
,
time_now
);
g_object_unref
(
message
);
return
;
}
message
=
chatty_pp_chat_find_message_with_id
(
CHATTY_PP_CHAT
(
chat
),
sms_id
);
if
(
message
)
chatty_message_set_status
(
message
,
sent_status
,
time_now
);
}
static
void
chatty_chat_view_map
(
GtkWidget
*
widget
)
{
...
...
@@ -660,9 +608,6 @@ chatty_chat_view_finalize (GObject *object)
{
ChattyChatView
*
self
=
(
ChattyChatView
*
)
object
;
g_hash_table_foreach_remove
(
ht_sms_id
,
chat_view_hash_table_match_item
,
self
);
g_clear_object
(
&
self
->
chat
);
G_OBJECT_CLASS
(
chatty_chat_view_parent_class
)
->
finalize
(
object
);
...
...
@@ -722,6 +667,7 @@ chatty_chat_view_class_init (ChattyChatViewClass *klass)
static
void
chatty_chat_view_init
(
ChattyChatView
*
self
)
{
GspellTextView
*
gspell_view
;
GtkAdjustment
*
vadjustment
;
gtk_widget_init_template
(
GTK_WIDGET
(
self
));
...
...
@@ -736,6 +682,9 @@ chatty_chat_view_init (ChattyChatView *self)
gtk_list_box_set_header_func
(
GTK_LIST_BOX
(
self
->
message_list
),
(
GtkListBoxUpdateHeaderFunc
)
chat_view_update_header_func
,
NULL
,
NULL
);
gspell_view
=
gspell_text_view_get_from_gtk_text_view
(
GTK_TEXT_VIEW
(
self
->
message_input
));
gspell_text_view_basic_setup
(
gspell_view
);
}
GtkWidget
*
...
...
@@ -744,29 +693,11 @@ chatty_chat_view_new (void)
return
g_object_new
(
CHATTY_TYPE_CHAT_VIEW
,
NULL
);
}
void
chatty_chat_view_purple_init
(
void
)
{
ht_sms_id
=
g_hash_table_new_full
(
g_str_hash
,
g_str_equal
,
g_free
,
g_object_unref
);
purple_signal_connect
(
purple_conversations_get_handle
(),
"sms-sent"
,
ht_sms_id
,
PURPLE_CALLBACK
(
chat_view_sms_sent_cb
),
NULL
);
}
void
chatty_chat_view_purple_uninit
(
void
)
{
purple_signals_disconnect_by_handle
(
ht_sms_id
);
g_hash_table_destroy
(
ht_sms_id
);
}
void
chatty_chat_view_set_chat
(
ChattyChatView
*
self
,
ChattyChat
*
chat
)
{
ChattyAccount
*
account
;
GListModel
*
messages
;
g_return_if_fail
(
CHATTY_IS_CHAT_VIEW
(
self
));
...
...
@@ -790,9 +721,20 @@ chatty_chat_view_set_chat (ChattyChatView *self,
return
;
messages
=
chatty_chat_get_messages
(
chat
);
account
=
chatty_chat_get_account
(
chat
);
if
(
g_list_model_get_n_items
(
messages
)
<=
3
)
chatty_chat_load_past_messages
(
chat
,
-
1
);
if
(
account
)
g_signal_connect_object
(
account
,
"notify::status"
,
G_CALLBACK
(
chat_account_status_changed_cb
),
self
,
G_CONNECT_SWAPPED
);
chat_account_status_changed_cb
(
self
);
gtk_list_box_bind_model
(
GTK_LIST_BOX
(
self
->
message_list
),
chatty_chat_get_messages
(
self
->
chat
),
(
GtkListBoxCreateWidgetFunc
)
chat_view_message_row_new
,
...
...
@@ -811,6 +753,8 @@ chatty_chat_view_set_chat (ChattyChatView *self,
chat_buddy_typing_changed_cb
(
self
);
chatty_chat_view_update
(
self
);
chat_view_adjustment_value_changed_cb
(
self
);
gtk_widget_grab_focus
(
self
->
message_input
);
}
ChattyChat
*
...
...
src/chatty-chat-view.h
View file @
82dccbbb
...
...
@@ -22,8 +22,6 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE
(
ChattyChatView
,
chatty_chat_view
,
CHATTY
,
CHAT_VIEW
,
GtkBox
)
GtkWidget
*
chatty_chat_view_new
(
void
);
void
chatty_chat_view_purple_init
(
void
);
void
chatty_chat_view_purple_uninit
(
void
);
void
chatty_chat_view_set_chat
(
ChattyChatView
*
self
,
ChattyChat
*
chat
);
ChattyChat
*
chatty_chat_view_get_chat
(
ChattyChatView
*
self
);
...
...
src/chatty-chat.c
View file @
82dccbbb
...
...
@@ -101,19 +101,6 @@ chatty_chat_real_get_chat_name (ChattyChat *self)
return
""
;
}
static
const
char
*
chatty_chat_real_get_username
(
ChattyChat
*
self
)
{
ChattyChatPrivate
*
priv
=
chatty_chat_get_instance_private
(
self
);
g_assert
(
CHATTY_IS_CHAT
(
self
));
if
(
priv
->
user_name
)
return
priv
->
user_name
;
return
""
;
}
static
ChattyAccount
*
chatty_chat_real_get_account
(
ChattyChat
*
self
)
{
...
...
@@ -303,6 +290,20 @@ chatty_chat_real_get_name (ChattyItem *item)
return
""
;
}
static
const
char
*
chatty_chat_real_get_username
(
ChattyItem
*
item
)
{
ChattyChat
*
self
=
(
ChattyChat
*
)
item
;
ChattyChatPrivate
*
priv
=
chatty_chat_get_instance_private
(
self
);
g_assert
(
CHATTY_IS_CHAT
(
self
));
if
(
priv
->
user_name
)
return
priv
->
user_name
;
return
""
;
}
static
void
chatty_chat_get_property
(
GObject
*
object
,
guint
prop_id
,
...
...
@@ -376,12 +377,12 @@ chatty_chat_class_init (ChattyChatClass *klass)
object_class
->
finalize
=
chatty_chat_finalize
;
item_class
->
get_name
=
chatty_chat_real_get_name
;
item_class
->
get_username
=
chatty_chat_real_get_username
;
klass
->
set_data
=
chatty_chat_real_set_data
;
klass
->
is_im
=
chatty_chat_real_is_im
;
klass
->
has_file_upload
=
chatty_chat_real_has_file_upload
;
klass
->
get_chat_name
=
chatty_chat_real_get_chat_name
;
klass
->
get_username
=
chatty_chat_real_get_username
;
klass
->
get_account
=
chatty_chat_real_get_account
;
klass
->
load_past_messages
=
chatty_chat_real_load_past_messages
;
klass
->
is_loading_history
=
chatty_chat_real_is_loading_history
;
...
...
@@ -520,14 +521,6 @@ chatty_chat_get_chat_name (ChattyChat *self)
return
CHATTY_CHAT_GET_CLASS
(
self
)
->
get_chat_name
(
self
);
}
const
char
*
chatty_chat_get_username
(
ChattyChat
*
self
)
{
g_return_val_if_fail
(
CHATTY_IS_CHAT
(
self
),
""
);
return
CHATTY_CHAT_GET_CLASS
(
self
)
->
get_username
(
self
);
}
ChattyAccount
*
chatty_chat_get_account
(
ChattyChat
*
self
)
{
...
...
src/chatty-chat.h
View file @
82dccbbb
...
...
@@ -34,7 +34,6 @@ struct _ChattyChatClass
gboolean
(
*
is_im
)
(
ChattyChat
*
self
);
gboolean
(
*
has_file_upload
)
(
ChattyChat
*
self
);
const
char
*
(
*
get_chat_name
)
(
ChattyChat
*
self
);
const
char
*
(
*
get_username
)
(
ChattyChat
*
self
);
ChattyAccount
*
(
*
get_account
)
(
ChattyChat
*
self
);
GListModel
*
(
*
get_messages
)
(
ChattyChat
*
self
);
GListModel
*
(
*
get_users
)
(
ChattyChat
*
self
);
...
...
@@ -89,7 +88,6 @@ void chatty_chat_set_data (ChattyChat *self,
gboolean
chatty_chat_is_im
(
ChattyChat
*
self
);
gboolean
chatty_chat_has_file_upload
(
ChattyChat
*
self
);
const
char
*
chatty_chat_get_chat_name
(
ChattyChat
*
self
);
const
char
*
chatty_chat_get_username
(
ChattyChat
*
self
);
ChattyAccount
*
chatty_chat_get_account
(
ChattyChat
*
self
);
GListModel
*
chatty_chat_get_messages
(
ChattyChat
*
self
);
void
chatty_chat_load_past_messages
(
ChattyChat
*
self
,
...
...
src/chatty-contact-provider.c
View file @
82dccbbb
...
...
@@ -115,10 +115,9 @@ chatty_eds_bus_got (GObject *object,
}
static
ChattyContact
*
chatty_contact_provider_matches
(
ChattyEds
*
self
,
const
char
*
needle
,
ChattyProtocol
protocols
,
gboolean
match_name
)
chatty_contact_provider_get_match
(
ChattyEds
*
self
,
const
char
*
value
,
ChattyProtocol
protocols
)
{
GListModel
*
model
;
guint
n_items
;
...
...
@@ -129,13 +128,13 @@ chatty_contact_provider_matches (ChattyEds *self,
for
(
guint
i
=
0
;
i
<
n_items
;
i
++
)
{
g_autoptr
(
Chatty
Item
)
item
=
NULL
;
g_autoptr
(
Chatty
Contact
)
contact
=
NULL
;
item
=
g_list_model_get_item
(
model
,
i
);
match
=
chatty_
item_matches
(
item
,
needle
,
protocols
,
match_name
);
contact
=
g_list_model_get_item
(
model
,
i
);
match
=
chatty_
contact_is_exact_match
(
contact
,
value
,
protocols
);
if
(
match
)
return
CHATTY_CONTACT
(
item
)
;
return
contact
;
}
return
NULL
;
...
...
@@ -191,7 +190,7 @@ chatty_eds_load_contact (ChattyEds *self,
if
(
self
->
protocols
&
CHATTY_PROTOCOL_CALL
)
protocol
=
CHATTY_PROTOCOL_CALL
;
else
protocol
=
CHATTY_PROTOCOL_SMS
;
protocol
=
CHATTY_PROTOCOL_
MMS_
SMS
;
}
else
if
(
field_id
==
E_CONTACT_IM_JABBER
)
{
protocol
=
CHATTY_PROTOCOL_XMPP
;
}
else
{
...
...
@@ -240,7 +239,7 @@ chatty_eds_objects_added_cb (ChattyEds *self,
for
(
GSList
*
l
=
(
GSList
*
)
objects
;
l
!=
NULL
;
l
=
l
->
next
)
{
if
(
self
->
protocols
&
CHATTY_PROTOCOL_SMS
||
if
(
self
->
protocols
&
CHATTY_PROTOCOL_
MMS_
SMS
||
self
->
protocols
&
CHATTY_PROTOCOL_CALL
)
chatty_eds_load_contact
(
self
,
l
->
data
,
E_CONTACT_TEL
);
...
...
@@ -641,7 +640,7 @@ chatty_eds_find_by_number (ChattyEds *self,
{
g_return_val_if_fail
(
CHATTY_IS_EDS
(
self
),
NULL
);
return
chatty_contact_provider_match
es
(