+/*
+ * Attempt to determine the closest thing to the "last seen message number" using the
+ * results of the GTSN command
+ */
+long bbsview_get_last_seen(void)
+{
+ char buf[SIZ] = "0";
+
+ serv_puts("GTSN");
+ serv_getln(buf, sizeof buf);
+ if (buf[0] == '2') {
+
+ char *comma_pos = strchr(buf, ','); /* kill first comma and everything to its right */
+ if (comma_pos) {
+ *comma_pos = 0;
+ }
+
+ char *colon_pos = strchr(buf, ':'); /* kill first colon and everything to its left */
+ if (colon_pos) {
+ strcpy(buf, ++colon_pos);
+ }
+ }
+
+ return(atol(buf));
+}
+
+
+