Commit ebe499c7 authored by Carl Schwan's avatar Carl Schwan 🚴

Add more app data extensions

* mailing list
* irc
* matrix
parent 11f24253
Pipeline #34610 passed with stage
in 3 minutes and 35 seconds
...@@ -481,7 +481,9 @@ class AppData ...@@ -481,7 +481,9 @@ class AppData
*/ */
public function getForum(): string public function getForum(): string
{ {
if (isset($this->raw['X-KDE-Forum'])) { if (isset($this->raw['Custom']) && isset($this->raw['Custom']['KDE::forum'])) {
return $this->raw['Custom']['KDE::forum'];
} else if (isset($this->raw['X-KDE-Forum'])) {
return 'https://forum.kde.org/viewforum.php?f='.$this->raw['X-KDE-Forum']; return 'https://forum.kde.org/viewforum.php?f='.$this->raw['X-KDE-Forum'];
} else { } else {
return 'https://forum.kde.org/'; return 'https://forum.kde.org/';
...@@ -489,12 +491,14 @@ class AppData ...@@ -489,12 +491,14 @@ class AppData
} }
/** /**
* Get AppData extension X-KDE-IRC * Get Application irc channel
* @return string[] * @return string[]
*/ */
public function getIrcChannels(): array public function getIrcChannels(): array
{ {
if (isset($this->raw['X-KDE-IRC'])) { if (isset($this->raw['Custom']) && isset($this->raw['Custom']['KDE::irc'])) {
return $this->raw['Custom']['KDE::irc'];
} else if (isset($this->raw['X-KDE-IRC'])) {
$irc = $this->raw['X-KDE-IRC']; $irc = $this->raw['X-KDE-IRC'];
if (is_array($irc)) { if (is_array($irc)) {
return $irc; return $irc;
...@@ -506,6 +510,18 @@ class AppData ...@@ -506,6 +510,18 @@ class AppData
} }
} }
/**
* Get Application matrix channel
* @return string[]
*/
public function getMatrixChannel(): ?string
{
if (isset($this->raw['Custom']) && isset($this->raw['Custom']['KDE::matrix'])) {
return $this->raw['Custom']['KDE::matrix'];
}
return null;
}
private function unifyMailingList(string $mailingList): string private function unifyMailingList(string $mailingList): string
{ {
if (endsWith($mailingList, '@kde.org')) { if (endsWith($mailingList, '@kde.org')) {
...@@ -524,11 +540,14 @@ class AppData ...@@ -524,11 +540,14 @@ class AppData
} }
/** /**
* AppData extension X-KDE-MailingLists * AppData extension X-KDE-MailingLists or KDE::mailinglist
* @return string[] * @return string[]
*/ */
public function getMailingLists(): array public function getMailingLists(): array
{ {
if (isset($this->raw['Custom']) && isset($this->raw['Custom']['KDE::mailinglist'])) {
return unifyMailingList($this->raw['Custom']['KDE::mailinglist']);
}
$ml = []; $ml = [];
if (isset($this->raw['X-KDE-MailingLists'])) { if (isset($this->raw['X-KDE-MailingLists'])) {
$ml = $this->raw['X-KDE-MailingLists']; $ml = $this->raw['X-KDE-MailingLists'];
...@@ -542,6 +561,18 @@ class AppData ...@@ -542,6 +561,18 @@ class AppData
return array_map('App\Model\AppData::unifyMailingList', $ml); return array_map('App\Model\AppData::unifyMailingList', $ml);
} }
/**
* AppData extension KDE::mailinglist-devel
* @return string[]
*/
public function getDevelMailingList(): ?string
{
if (isset($this->raw['Custom']) && isset($this->raw['Custom']['KDE::mailinglist-devel'])) {
return unifyMailingList($this->raw['Custom']['KDE::mailinglist-devel']);
}
return null;
}
/** /**
* AppData extension X-KDE-Repository * AppData extension X-KDE-Repository
* @return string|null * @return string|null
......
...@@ -265,7 +265,13 @@ AppStream application stores. You can also use your distribution's package manag ...@@ -265,7 +265,13 @@ AppStream application stores. You can also use your distribution's package manag
{% trans %}Report a bug{% endtrans %} {% trans %}Report a bug{% endtrans %}
</a> </a>
</div> </div>
{% else %} {% endif %}
{% if application.matrixChannel is not null %}
{% trans %}Matrix:{% endtrans %}
<a href="https://webchat.kde.org/#/room/{{ application.matrixChannel }}">
{{ application.matrixChannel }}
</a>
<br/>
{% endif %} {% endif %}
{% if application.ircChannels | length > 0 %} {% if application.ircChannels | length > 0 %}
{% trans %}IRC:{% endtrans %} {% trans %}IRC:{% endtrans %}
...@@ -283,6 +289,13 @@ AppStream application stores. You can also use your distribution's package manag ...@@ -283,6 +289,13 @@ AppStream application stores. You can also use your distribution's package manag
</a> </a>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% if application.develMailingList is not null %}
{% trans %}Developer mailing list:{% endtrans %}
<a href="https://mail.kde.org/mailman/listinfo/{{ application.develMailingList }}">
{{ application.develMailingList }}@kde.org
</a>
<br/>
{% endif %}
{% if application.authors is not null %} {% if application.authors is not null %}
<div> <div>
<b>{% trans %}Author(s):{% endtrans %}</b> <b>{% trans %}Author(s):{% endtrans %}</b>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment