AmendHub

Download:

jcs

/

subtext

/

amendments

/

63

session: Add %%PHONE_NUMBER%% variable for views


jcs made amendment 63 over 2 years ago
--- session.c Thu Jan 20 15:35:11 2022 +++ session.c Sat Jan 22 20:40:21 2022 @@ -617,13 +617,15 @@ session_load_view(struct session *session, short id, c if (strcmp(curvar, "NODE") == 0) { vallen = strlcpy(curvar, session->node, valsize); + } else if (strcmp(curvar, "PHONE_NUMBER") == 0) { + vallen = strlcpy(curvar, db->config.phone_number, valsize); + } else if (strcmp(curvar, "TIME") == 0) { + now = localtime((time_t *)&Time); + vallen = strftime(curvar, valsize, "%H:%M", now); } else if (strcmp(curvar, "USERNAME") == 0) { vallen = strlcpy(curvar, session->user ? session->user->username : GUEST_USERNAME, valsize); - } else if (strcmp(curvar, "TIME") == 0) { - now = localtime((time_t *)&Time); - vallen = strftime(curvar, valsize, "%H:%M", now); } else if (strcmp(curvar, "ANSI_BOLD") == 0) { vallen = strlcpy(curvar, ansi(session, ANSI_BOLD, ANSI_END), valsize);