- q("INSERT INTO `push_subscriber` (`uid`, `callback_url`, " .
- "`topic`, `nickname`, `push`, `last_update`, `secret`) values " .
- "(%d, '%s', '%s', '%s', %d, '%s', '%s')",
- intval($owner['uid']),
- dbesc($hub_callback),
- dbesc($hub_topic),
- dbesc($nick),
- intval($push_flag),
- dbesc($last_update),
- dbesc($hub_secret));
- logger("pubsubhubbub: successfully subscribed [$hub_callback].");
+ $fields = ['uid' => $owner['uid'], 'callback_url' => $hub_callback,
+ 'topic' => $hub_topic, 'nickname' => $nick, 'push' => $push_flag,
+ 'last_update' => $last_update, 'renewed' => DateTimeFormat::utcNow(),
+ 'secret' => $hub_secret];
+ dba::insert('push_subscriber', $fields);
+
+ logger("Successfully subscribed [$hub_callback].");