Browse Source

Merge branch 'main' into lang_de

lang_de
Stephan Richter 3 years ago
parent
commit
99611fd654
  1. 2
      pom.xml
  2. 6
      src/main/java/de/srsoftware/widerhall/data/ListMember.java
  3. 1
      src/main/java/de/srsoftware/widerhall/data/User.java
  4. 3
      src/main/java/de/srsoftware/widerhall/web/Rest.java

2
pom.xml

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
<groupId>org.example</groupId>
<artifactId>Widerhall</artifactId>
<version>0.2.60</version>
<version>0.2.61</version>
<build>
<plugins>
<plugin>

6
src/main/java/de/srsoftware/widerhall/data/ListMember.java

@ -69,9 +69,9 @@ public class ListMember { @@ -69,9 +69,9 @@ public class ListMember {
}
try {
if (member == null) {
ListMember.create(list, moderator, ListMember.STATE_MODERATOR);
ListMember.create(list, moderator, STATE_MODERATOR);
} else {
member.setState((member.state | STATE_MODERATOR) ^ STATE_AWAITING_CONFIRMATION);
member.setState(Util.unset(member.state|STATE_MODERATOR,STATE_AWAITING_CONFIRMATION));
}
} catch (SQLException e) {
LOG.warn("Ernennen von {} zum Moderator von {} fehlgeschlagen",moderator.email(),list.email(),e);
@ -212,7 +212,7 @@ public class ListMember { @@ -212,7 +212,7 @@ public class ListMember {
if (member == null) {
ListMember.create(list, moderator, ListMember.STATE_SUBSCRIBER);
} else {
member.setState(ListMember.STATE_SUBSCRIBER);
member.setState(Util.unset(member.state,STATE_MODERATOR));
}
} catch (SQLException e) {
LOG.warn("Ernennen von {} zum normalen Abonnenten von {} fehlgeschlagen",moderator.email(),list.email(),e);

1
src/main/java/de/srsoftware/widerhall/data/User.java

@ -175,6 +175,7 @@ public class User { @@ -175,6 +175,7 @@ public class User {
if (emails != null) query.where(EMAIL,emails);
var rs = query.compile().exec();
while (rs.next()) userList.add(User.from(rs));
Collections.sort(userList,(u1,u2)->u1.name.compareTo(u2.name));
return userList;
}

3
src/main/java/de/srsoftware/widerhall/web/Rest.java

@ -167,7 +167,7 @@ public class Rest extends HttpServlet { @@ -167,7 +167,7 @@ public class Rest extends HttpServlet {
}
break;
case LIST_MODERATED:
json.put("lists", MailingList.moderatedBy(user).stream().map(MailingList::safeMap).toList());
json.put("lists", MailingList.moderatedBy(user).stream().sorted((l1,l2)->l1.name().compareTo(l2.name())).map(MailingList::safeMap).toList());
break;
case LIST_SUBSCRIBABLE:
json.put("lists", MailingList.subscribable(user).stream().map(MailingList::minimalMap).toList());
@ -348,6 +348,7 @@ public class Rest extends HttpServlet { @@ -348,6 +348,7 @@ public class Rest extends HttpServlet {
if (!list.membersMayBeListedBy(user)) Map.of(ERROR,t("Es ist dir nicht gestattet, die Mitglieder von '{}' aufzulisten",list.email()));
try {
var members = list.members()
.sorted((m1,m2)->m1.user().name().compareTo(m2.user().name()))
.map(ListMember::safeMap)
.toList();
return Map.of(MEMBERS,members,LIST,list.minimalMap());

Loading…
Cancel
Save