Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Evangelos Ribeiro Tzaras
chatty
Commits
2911bea4
Commit
2911bea4
authored
Aug 15, 2020
by
Mohammed Sadiq
Committed by
Mohammed Sadiq
Aug 15, 2020
Browse files
chat-view: Replace purple APIs with chatty-chat APIs
parent
3fb670ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/chatty-chat-view.c
View file @
2911bea4
...
...
@@ -326,15 +326,13 @@ chatty_update_typing_status (ChattyChatView *self)
PurpleConvIm
*
im
;
GtkTextIter
start
,
end
;
g_autofree
char
*
text
=
NULL
;
PurpleConversationType
type
;
gboolean
empty
;
g_assert
(
CHATTY_IS_CHAT_VIEW
(
self
));
conv
=
self
->
conv
;
type
=
purple_conversation_get_type
(
conv
);
if
(
type
!=
PURPLE_CONV_TYPE_IM
)
if
(
!
chatty_chat_is_im
(
self
->
chat
)
)
return
;
gtk_text_buffer_get_bounds
(
self
->
message_input_buffer
,
&
start
,
&
end
);
...
...
@@ -668,17 +666,15 @@ static void
chat_view_send_message_button_clicked_cb
(
ChattyChatView
*
self
)
{
PurpleConversation
*
conv
;
Purple
Account
*
account
;
Chatty
Account
*
account
;
GtkTextIter
start
,
end
;
gchar
*
message
=
NULL
;
const
gchar
*
protocol_id
;
gchar
*
sms_id_str
;
guint
sms_id
;
g_assert
(
CHATTY_IS_CHAT_VIEW
(
self
));
conv
=
self
->
conv
;
account
=
purple_conversation_get_account
(
conv
);
gtk_text_buffer_get_bounds
(
self
->
message_input_buffer
,
&
start
,
&
end
);
...
...
@@ -689,11 +685,10 @@ chat_view_send_message_button_clicked_cb (ChattyChatView *self)
return
;
}
if
(
!
purple_account_is_connected
(
account
))
account
=
chatty_chat_get_account
(
self
->
chat
);
if
(
chatty_account_get_status
(
account
)
!=
CHATTY_CONNECTED
)
return
;
protocol_id
=
purple_account_get_protocol_id
(
account
);
gtk_widget_grab_focus
(
self
->
message_input
);
purple_idle_touch
();
...
...
@@ -701,7 +696,7 @@ chat_view_send_message_button_clicked_cb (ChattyChatView *self)
if
(
gtk_text_buffer_get_char_count
(
self
->
message_input_buffer
))
{
/* provide a msg-id to the sms-plugin for send-receipts */
if
(
g_strcmp0
(
protocol_id
,
"prpl-mm-sms"
)
==
0
)
{
if
(
chatty_chat_get_protocol
(
self
->
chat
)
==
CHATTY_PROTOCOL_SMS
)
{
sms_id
=
g_random_int
();
sms_id_str
=
g_strdup_printf
(
"%i"
,
sms_id
);
...
...
@@ -755,14 +750,10 @@ chat_view_input_key_pressed_cb (ChattyChatView *self,
static
void
chat_view_message_input_changed_cb
(
ChattyChatView
*
self
)
{
PurpleAccount
*
account
;
const
gchar
*
protocol
;
gboolean
has_text
;
gboolean
has_text
;
g_assert
(
CHATTY_IS_CHAT_VIEW
(
self
));
account
=
purple_conversation_get_account
(
self
->
conv
);
protocol
=
purple_account_get_protocol_id
(
account
);
has_text
=
gtk_text_buffer_get_char_count
(
self
->
message_input_buffer
)
>
0
;
gtk_widget_set_visible
(
self
->
send_message_button
,
has_text
);
...
...
@@ -770,7 +761,7 @@ chat_view_message_input_changed_cb (ChattyChatView *self)
chatty_update_typing_status
(
self
);
if
(
chatty_settings_get_convert_emoticons
(
chatty_settings_get_default
())
&&
(
g_strcmp0
(
protocol
,
"prpl-mm-sms"
)
!=
0
)
)
chatty_chat_get_protocol
(
self
->
chat
)
!=
CHATTY_PROTOCOL_SMS
)
chatty_check_for_emoticon
(
self
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment