adding preference option for dynamic input blocking

/inpblock is now having subcommands 'timeout' and 'dynamic'
with:

/inpblock timeout <milliseconds>

and

/inpblock dynamic <on|off>

Defaults are:

/inpblock timeout 500
/inpblock dynamic on

To get the old behavior specify:

/inpblock timeout 20
/inpblock dynamic off

The dynamic mode will block incrementally after something
should be written to the window or after a key was pressed. So pressing
a key would set the timeout to 0ms and after 10 timeouts to the next
bigger one.

Example (with dynamic mode on):

"/inpblock timeout 50"

timeout series:

10x 0ms
10x 10ms (0ms + 10 times since last keypress)
10x 30ms (10ms + 20 times since last keypress)
*x50ms until next key was pressed or
This commit is contained in:
Simon Effenberg
2015-01-12 11:32:32 +01:00
parent c7ff3255b8
commit 34148e2101
6 changed files with 62 additions and 14 deletions

View File

@@ -531,6 +531,7 @@ _get_group(preference_t pref)
case PREF_ROSTER_BY:
case PREF_RESOURCE_TITLE:
case PREF_RESOURCE_MESSAGE:
case PREF_INPBLOCK_DYNAMIC:
return PREF_GROUP_UI;
case PREF_STATES:
case PREF_OUTTYPE:
@@ -672,6 +673,8 @@ _get_key(preference_t pref)
return "resource.title";
case PREF_RESOURCE_MESSAGE:
return "resource.message";
case PREF_INPBLOCK_DYNAMIC:
return "inpblock.dynamic";
default:
return NULL;
}
@@ -696,6 +699,7 @@ _get_default_boolean(preference_t pref)
case PREF_MUC_PRIVILEGES:
case PREF_PRESENCE:
case PREF_WRAP:
case PREF_INPBLOCK_DYNAMIC:
return TRUE;
default:
return FALSE;

View File

@@ -100,7 +100,8 @@ typedef enum {
PREF_OTR_WARN,
PREF_OTR_POLICY,
PREF_RESOURCE_TITLE,
PREF_RESOURCE_MESSAGE
PREF_RESOURCE_MESSAGE,
PREF_INPBLOCK_DYNAMIC
} preference_t;
typedef struct prof_alias_t {