| 209 | |
| 210 | |
| 211 | GVariant *RequiresQueue::QueueFetchGVariant(GVariant *parameters) const |
| 212 | { |
| 213 | glib2::Utils::checkParams(__func__, parameters, "(uuu)", 3); |
| 214 | ClientAttentionType type = glib2::Value::Extract<ClientAttentionType>(parameters, 0); |
| 215 | ClientAttentionGroup group = glib2::Value::Extract<ClientAttentionGroup>(parameters, 1); |
| 216 | uint32_t id = glib2::Value::Extract<uint32_t>(parameters, 2); |
| 217 | |
| 218 | // Fetch the requested slot id |
| 219 | for (auto &e : slots) |
| 220 | { |
| 221 | if (id == e.id) |
| 222 | { |
| 223 | if (e.type == type |
| 224 | && e.group == group) |
| 225 | { |
| 226 | if (e.provided) |
| 227 | { |
| 228 | throw RequiresQueueException("net.openvpn.v3.already-provided", |
| 229 | "User input already provided"); |
| 230 | } |
| 231 | |
| 232 | GVariant *elmt = g_variant_new("(uuussb)", |
| 233 | e.type, |
| 234 | e.group, |
| 235 | e.id, |
| 236 | e.name.c_str(), |
| 237 | e.user_description.c_str(), |
| 238 | e.hidden_input); |
| 239 | callbacks.RunCallback(CallbackType::QUEUE_FETCH); |
| 240 | return elmt; |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | throw RequiresQueueException("net.openvpn.v3.element-not-found", |
| 245 | "No requires queue element found"); |
| 246 | } |
| 247 | |
| 248 | |
| 249 | void RequiresQueue::UpdateEntry(ClientAttentionType type, |
no test coverage detected