|
|
|
@ -3,6 +3,7 @@ package de.srsoftware.widerhall.data;
@@ -3,6 +3,7 @@ package de.srsoftware.widerhall.data;
|
|
|
|
|
import de.srsoftware.widerhall.Util; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.stringtemplate.v4.ST; |
|
|
|
|
|
|
|
|
|
import javax.xml.crypto.Data; |
|
|
|
|
import java.sql.SQLException; |
|
|
|
@ -87,15 +88,17 @@ public class ListMember {
@@ -87,15 +88,17 @@ public class ListMember {
|
|
|
|
|
var words = new ArrayList<String>(); |
|
|
|
|
if ((state & STATE_OWNER) > 0) words.add("owner"); |
|
|
|
|
if ((state & STATE_SUBSCRIBER) > 0) words.add("subscriber"); |
|
|
|
|
if ((state & STATE_AWAITING_CONFIRMATION) > 0) words.add("awaiting confirmation"); |
|
|
|
|
return String.join(", ",words); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ListMember save() throws SQLException { |
|
|
|
|
Database.open().insertInto(TABLE_NAME) |
|
|
|
|
.values(Map.of(LIST_EMAIL,listEmail, |
|
|
|
|
USER_EMAIL,userEmail, |
|
|
|
|
STATE,state)) |
|
|
|
|
.run(); |
|
|
|
|
var vals = new HashMap<String,Object>(); |
|
|
|
|
vals.put(LIST_EMAIL,listEmail); |
|
|
|
|
vals.put(USER_EMAIL,userEmail); |
|
|
|
|
vals.put(STATE,state); |
|
|
|
|
if (token != null) vals.put(TOKEN,token); |
|
|
|
|
Database.open().insertInto(TABLE_NAME).values(vals).run(); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|