getSessionHookCallback method
SessionHookEntry?
getSessionHookCallback({
- required String sessionId,
- required HookEvent event,
- required String matcher,
- required HookCommand hook,
Get callback info for a specific session hook.
Implementation
SessionHookEntry? getSessionHookCallback({
required String sessionId,
required HookEvent event,
required String matcher,
required HookCommand hook,
}) {
final store = _stores[sessionId];
if (store == null) return null;
final eventMatchers = store.hooks[event];
if (eventMatchers == null) return null;
for (final matcherEntry in eventMatchers) {
if (matcherEntry.matcher == matcher || matcher.isEmpty) {
for (final hookEntry in matcherEntry.hooks) {
if (isHookEqual(hookEntry.hook, hook)) {
return hookEntry;
}
}
}
}
return null;
}