Warning: session_start(): open(/var/lib/php/sessions/sess_2iuthfrr2qsonm93gm9di9hp9i, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
concept User {
S channelID, name;
long greeted;
}
module GreetNewVisitors > DynPrintLogAndEnabled {
start {
db();
dm_vmBus_onMessage_q('gotYouTubeLiveStreamMessage, voidfunc(O msg) {
if (!enabled) ret;
S publishedAt = getString(msg, 'publishedAt);
if (cmp(publishedAt, ymdWithMinuses(now()-hoursToMS(2))) < 0) ret; // general ignore-old-messages safety thing (rough)
S channelID = getString(msg, 'authorChannelId);
S name = getString(msg, 'authorDisplayName);
if (empty(channelID)) ret;
print("Got recent message from " + name + " (" + channelID + ")");
User user = uniq_sync(User, +channelID);
cset(user, +name);
if (user.greeted == 0) {
user.greeted = now();
print("Hello " + name);
}
});
}
}