This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Add option to hide the "playback" message #13
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8d94950
Add option to hide playback message
Valinwolf 5404995
Fixed undefined variable
Valinwolf e99e77d
Added code safety & separated declaration of gc
Valinwolf 752b3ba
Convert from account to plugin setting
Valinwolf 4081942
Removed code no longer necessary
Valinwolf d956426
Remove more residual code
Valinwolf 72e708e
Fix whitespace
Valinwolf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,6 +98,7 @@ static void znc_write_chat( | |
PurpleConversation *conv, const char *who, const char *message, | ||
PurpleMessageFlags flags, time_t mtime | ||
) { | ||
PurpleConnection *gc = purple_conversation_get_gc(conv); | ||
PurpleConvChat *chat; | ||
struct znc_conn *znc; | ||
GList *parted, *l; | ||
|
@@ -122,10 +123,12 @@ static void znc_write_chat( | |
state = GPOINTER_TO_INT(purple_conversation_get_data(conv, "znc-state")); | ||
switch(state) { | ||
case ZNC_CONV_STATE_START: | ||
ui_write_chat( | ||
conv, "***", _("Buffer Playback..."), | ||
PURPLE_MESSAGE_NO_LOG | PURPLE_MESSAGE_SYSTEM, time(NULL) | ||
); | ||
if(!purple_account_get_bool(gc->account, "hide_znc_playback_message", FALSE)) { | ||
ui_write_chat( | ||
conv, "***", _("Buffer Playback..."), | ||
PURPLE_MESSAGE_NO_LOG | PURPLE_MESSAGE_SYSTEM, time(NULL) | ||
); | ||
} | ||
purple_conversation_set_data(conv, | ||
"znc-state", GINT_TO_POINTER(ZNC_CONV_STATE_REPLAY) | ||
); | ||
|
@@ -329,10 +332,12 @@ static void parse_endofwho(PurpleConnection *gc, char **text) { | |
goto exit; | ||
} | ||
|
||
ui_write_chat( | ||
conv, "***", _("Playback Complete."), | ||
PURPLE_MESSAGE_NO_LOG | PURPLE_MESSAGE_SYSTEM, time(NULL) | ||
); | ||
if(!purple_account_get_bool(gc->account, "hide_znc_playback_message", FALSE)) { | ||
ui_write_chat( | ||
conv, "***", _("Playback Complete."), | ||
PURPLE_MESSAGE_NO_LOG | PURPLE_MESSAGE_SYSTEM, time(NULL) | ||
); | ||
} | ||
|
||
/* Remove all users from the chat that are in the playback but | ||
* not present anymore. This gives the UI the chance to mark | ||
|
@@ -444,6 +449,7 @@ static void core_quitting_cb() { | |
|
||
static gboolean plugin_load(PurplePlugin *plugin) { | ||
PurpleAccountOption *option; | ||
PurpleAccountOption *option2; | ||
GList *convs; | ||
|
||
prpl_irc = purple_find_prpl("prpl-irc"); | ||
|
@@ -462,7 +468,12 @@ static gboolean plugin_load(PurplePlugin *plugin) { | |
option = purple_account_option_bool_new( | ||
_("Uses ZNC bouncer"), "uses_znc_bouncer", FALSE | ||
); | ||
option2 = purple_account_option_bool_new( | ||
_("Hide ZNC Playback Message"), "hide_znc_playback_message", FALSE | ||
); | ||
irc_info->protocol_options = g_list_append(irc_info->protocol_options, option); | ||
irc_info->protocol_options = g_list_append(irc_info->protocol_options, option2); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove newline |
||
|
||
znc_conns = g_hash_table_new_full(NULL, NULL, NULL, g_free); | ||
|
||
|
@@ -525,7 +536,7 @@ static gboolean plugin_unload(PurplePlugin *plugin) { | |
for(l = irc_info->protocol_options; l != NULL; l = l->next) { | ||
option = (PurpleAccountOption *)l->data; | ||
setting = purple_account_option_get_setting(option); | ||
if(setting && g_str_equal(setting, "uses_znc_bouncer")) { | ||
if(setting && (g_str_equal(setting, "uses_znc_bouncer") || g_str_equal(setting, "hide_znc_playback_message"))) { | ||
irc_info->protocol_options = g_list_delete_link( | ||
irc_info->protocol_options, l | ||
); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please don't mix up declarations and code and make sure to check the return values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix that right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit added to fix this