$ git clone http://tcclient.ion.nu/tc_client.git
commit 3ee85a610a078f315e4b8a7f4badb451d9f7e890
Author: Alicia <...>
Date: Fri Nov 25 12:12:11 2016 +0100
tc_client-gtk: added a setting to control /disablesnapshots and /enablesnapshots.
diff --git a/ChangeLog b/ChangeLog
index 11c3388..6da69e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@ tc_client-gtk: added volume indicators.
tc_client-gtk: handle failure to connect to pulseaudio more gracefully.
tc_client-gtk: rewrote the audio mixer.
tc_client-gtk: display the channel name in the window title.
+tc_client-gtk: added a setting to control /disablesnapshots and /enablesnapshots.
dist/appimage.sh: fix audio in appimages by building ffmpeg with support for nellymoser and speex, and depending on the system's libao and libpulse instead of including it in the appimage.
libcamera(escapi): handle failure to open camera more gracefully.
irchack: pass along "<user> cammed up" notifications.
diff --git a/gtkgui.glade b/gtkgui.glade
index 2520cd6..e5bfeed 100644
--- a/gtkgui.glade
+++ b/gtkgui.glade
@@ -1023,6 +1023,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
+ <property name="spacing">8</property>
<child>
<object class="GtkCheckButton" id="camdownonjoin">
<property name="visible">True</property>
@@ -1069,6 +1070,29 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="disablesnapshots">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <child>
+ <object class="GtkLabel" id="label36">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Disable the flash client's snapshot feature (your outgoing cam will just show up as a black rectangle)</property>
+ <property name="wrap">True</property>
+ <property name="wrap_mode">word-char</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/utilities/gtk/camviewer.c b/utilities/gtk/camviewer.c
index b189dbc..5423f16 100644
--- a/utilities/gtk/camviewer.c
+++ b/utilities/gtk/camviewer.c
@@ -267,6 +267,7 @@ gboolean handledata(GIOChannel* iochannel, GIOCondition condition, gpointer x)
}
if(!strncmp(buf, "Connection ID: ", 15)) // Our initial nickname is "guest-" plus our connection ID
{
+ if(config_get_bool("disablesnapshots")){write(tc_client_in[1], "/disablesnapshots\n", 18);}
write(tc_client_in[1], "/color\n", 7); // Check which random color tc_client picked
unsigned int length=strlen(&buf[15]);
nickname=malloc(length+strlen("guest-")+1);
diff --git a/utilities/gtk/gui.c b/utilities/gtk/gui.c
index 14b8122..47da826 100644
--- a/utilities/gtk/gui.c
+++ b/utilities/gtk/gui.c
@@ -88,6 +88,8 @@ void settings_reset(GtkBuilder* gui)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(option), config_get_bool("camdownonjoin"));
option=GTK_WIDGET(gtk_builder_get_object(gui, "autoopencams"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(option), config_get_set("autoopencams")?config_get_bool("autoopencams"):1);
+ option=GTK_WIDGET(gtk_builder_get_object(gui, "disablesnapshots"));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(option), config_get_bool("disablesnapshots"));
// Misc/cookies
option=GTK_WIDGET(gtk_builder_get_object(gui, "storecookiecheckbox"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(option), config_get_bool("storecookies"));
@@ -148,6 +150,13 @@ void savesettings(GtkButton* button, GtkBuilder* gui)
config_set("camdownonjoin", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(option))?"True":"False");
option=GTK_WIDGET(gtk_builder_get_object(gui, "autoopencams"));
config_set("autoopencams", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(option))?"True":"False");
+ option=GTK_WIDGET(gtk_builder_get_object(gui, "disablesnapshots"));
+ char v=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(option));
+ if(nickname && v!=config_get_bool("disablesnapshots"))
+ {
+ write(tc_client_in[1], v?"/disablesnapshots\n":"/enablesnapshots\n", v?18:17);
+ }
+ config_set("disablesnapshots", v?"True":"False");
// Misc/cookies
option=GTK_WIDGET(gtk_builder_get_object(gui, "storecookiecheckbox"));
config_set("storecookies", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(option))?"True":"False");
diff --git a/utilities/gtk/main.h b/utilities/gtk/main.h
index dabfbb3..8443ba6 100644
--- a/utilities/gtk/main.h
+++ b/utilities/gtk/main.h
@@ -14,6 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+extern char* nickname;
extern void togglecam(GtkCheckMenuItem* item, void* x);
#ifdef HAVE_PULSEAUDIO
void togglemic(GtkCheckMenuItem* item, void* x);