- // Sort capabilities before requesting for consistency among networks. This may avoid
- // unexpected cases when some networks offer capabilities in a different order than
- // others. It also looks nicer in logs. Not required.
- availableCaps.sort();
- // Store what capabilities are available
- QString availableCapName, availableCapValue;
- for (int i = 0; i < availableCaps.count(); ++i) {
- // Capability may include values, e.g. CAP * LS :multi-prefix sasl=EXTERNAL
- // Capability name comes before the first '='. If no '=' exists, this gets the
- // whole string instead.
- availableCapName = availableCaps[i].section('=', 0, 0).trimmed();
- // Some capabilities include multiple key=value pairs in the listing,
- // e.g. "sts=duration=31536000,port=6697"
- // Include everything after the first equal sign as part of the value. If no '='
- // exists, this gets an empty string.
- availableCapValue = availableCaps[i].section('=', 1).trimmed();
- // Only add the capability if it's non-empty
- if (!availableCapName.isEmpty()) {
- coreNet->addCap(availableCapName, availableCapValue);
- }
+ }
+ // Sort capabilities before requesting for consistency among networks. This may avoid
+ // unexpected cases when some networks offer capabilities in a different order than
+ // others. It also looks nicer in logs. Not required.
+ availableCaps.sort();
+ // Store what capabilities are available
+ QString availableCapName, availableCapValue;
+ for (int i = 0; i < availableCaps.count(); ++i) {
+ // Capability may include values, e.g. CAP * LS :multi-prefix sasl=EXTERNAL
+ // Capability name comes before the first '='. If no '=' exists, this gets the
+ // whole string instead.
+ availableCapName = availableCaps[i].section('=', 0, 0).trimmed();
+ // Some capabilities include multiple key=value pairs in the listing,
+ // e.g. "sts=duration=31536000,port=6697"
+ // Include everything after the first equal sign as part of the value. If no '='
+ // exists, this gets an empty string.
+ availableCapValue = availableCaps[i].section('=', 1).trimmed();
+ // Only add the capability if it's non-empty
+ if (!availableCapName.isEmpty()) {
+ coreNet->addCap(availableCapName, availableCapValue);