]> git.pld-linux.org Git - packages/ekg.git/blame - ekg-lock_reason.patch
- use __rm macro, explicit files in system dirs
[packages/ekg.git] / ekg-lock_reason.patch
CommitLineData
d7eabc96
AG
1Simple patch that introduces new variable - `lock_reason'. Setting it to 1 causes
2ekg to ignore any attempts to change status description still allowing to change
3status itself (busy/available/...).
4
5Sounds stupid, but I'm really attached to my current status ...
6
7diff -burN ekg-1.6.orig/src/commands.c ekg-1.6/src/commands.c
8--- ekg-1.6.orig/src/commands.c 2006-08-18 00:20:55.000000000 +0200
9+++ ekg-1.6/src/commands.c 2006-08-18 00:42:10.000000000 +0200
10@@ -448,16 +448,31 @@
11 return -1;
12 }
13
14- if (!strcasecmp(name, "_descr"))
15+ if (!strcasecmp(name, "_descr")) {
16+ if (config_lock_reason)
17+ change_status(config_status, config_reason, q);
18+ else
19 change_status(config_status, params[0], q);
20+ }
21
22- if (!strcasecmp(name, "away"))
23+ if (!strcasecmp(name, "away")) {
24+ if (config_lock_reason)
25+ change_status(GG_STATUS_BUSY, config_reason, q);
26+ else
27 change_status(GG_STATUS_BUSY, params[0], q);
28+ }
29
30- if (!strcasecmp(name, "invisible"))
31+ if (!strcasecmp(name, "invisible")) {
32+ if (config_lock_reason)
33+ change_status(GG_STATUS_INVISIBLE, config_reason, q);
34+ else
35 change_status(GG_STATUS_INVISIBLE, params[0], q);
36+ }
37
38 if (!strcasecmp(name, "back")) {
39+ if (config_lock_reason)
40+ change_status(GG_STATUS_AVAIL, config_reason, q);
41+ else
42 change_status(GG_STATUS_AVAIL, params[0], q);
43 sms_away_free();
44 }
45@@ -489,7 +504,7 @@
46 if (sess && sess->state == GG_STATE_CONNECTED) {
47 gg_debug(GG_DEBUG_MISC, "-- config_status = 0x%.2x\n", config_status);
48
49- if (config_reason) {
50+ if (config_reason && !config_lock_reason) {
84597fba 51 iso_to_cp(config_reason);
d7eabc96 52 gg_change_status_descr(sess, config_status, config_reason);
84597fba 53 cp_to_iso(config_reason);
d7eabc96
AG
54diff -burN ekg-1.6.orig/src/stuff.c ekg-1.6/src/stuff.c
55--- ekg-1.6.orig/src/stuff.c 2006-08-18 00:20:55.000000000 +0200
56+++ ekg-1.6/src/stuff.c 2006-08-18 00:35:53.000000000 +0200
57@@ -171,6 +171,7 @@
58 int config_display_sent = 1;
59 int config_sort_windows = 0;
60 int config_keep_reason = 0;
61+int config_lock_reason = 0;
62 int config_enter_scrolls = 0;
63 int server_index = 0;
64 char *config_audio_device = NULL;
65diff -burN ekg-1.6.orig/src/stuff.h ekg-1.6/src/stuff.h
66--- ekg-1.6.orig/src/stuff.h 2006-08-18 00:20:55.000000000 +0200
67+++ ekg-1.6/src/stuff.h 2006-08-18 00:36:00.000000000 +0200
68@@ -279,6 +279,7 @@
69 int config_last_sysmsg;
70 int config_last_sysmsg_changed;
71 char *config_local_ip;
72+int config_lock_reason;
73 int config_log;
74 int config_log_ignored;
75 char *config_log_path;
76diff -burN ekg-1.6.orig/src/vars.c ekg-1.6/src/vars.c
77--- ekg-1.6.orig/src/vars.c 2006-08-18 00:20:55.000000000 +0200
78+++ ekg-1.6/src/vars.c 2006-08-18 00:43:59.000000000 +0200
79@@ -247,6 +247,7 @@
80 variable_add("last", "la", VAR_MAP, 1, &config_last, NULL, variable_map(4, 0, 0, "none", 1, 2, "all", 2, 1, "separate", 4, 0, "sent"), NULL);
81 variable_add("last_size", "ls", VAR_INT, 1, &config_last_size, NULL, NULL, NULL);
82 variable_add("local_ip", "ld", VAR_STR, 1, &config_local_ip, changed_local_ip, NULL, NULL);
83+ variable_add("lock_reason", "lr", VAR_INT, 1, &config_lock_reason, NULL, NULL, NULL);
84 variable_add("log", "lo", VAR_MAP, 1, &config_log, NULL, variable_map(4, 0, 0, "none", 1, 2, "file", 2, 1, "dir", 4, 0, "gzip"), NULL);
85 variable_add("log_ignored", "li", VAR_INT, 1, &config_log_ignored, NULL, NULL, dd_log);
86 variable_add("log_status", "lS", VAR_INT, 1, &config_log_status, NULL, variable_map(3, 0, 0, "no", 1, 2, "yes", 2, 1, "descr"), dd_log);
This page took 0.043163 seconds and 4 git commands to generate.