Skip to content
Snippets Groups Projects
Commit a7f363fd authored by rswindell's avatar rswindell
Browse files

Include the vote(s) in the message (telegram) sent to the pollster upon a

posted vote msg - the format of the vote(s) is currently hard-coded and not
colorized/pretty. This'll require an update to the PollVoteNotice text.dat
line.
parent 08a7b338
Branches
Tags
No related merge requests found
......@@ -565,17 +565,32 @@ extern "C" int DLLCALL votemsg(scfg_t* cfg, smb_t* smb, smbmsg_t* msg, const cha
(stricmp(remsg.from, user.alias) == 0 || stricmp(remsg.from, user.name) == 0)) {
char from[256];
char tstr[128];
char smsg[256];
char smsg[4000];
char votes[3000] = "";
if(msg->from_net.type)
safe_snprintf(from, sizeof(from), "%s (%s)", msg->from, smb_netaddr(&msg->from_net));
else
SAFECOPY(from, msg->from);
if(remsg.hdr.type == SMB_MSG_TYPE_POLL) {
int answers = 0;
for(int i=0; i<remsg.total_hfields; i++) {
if(remsg.hfield[i].type == SMB_POLL_ANSWER) {
if(msg->hdr.votes&(1<<answers)) {
char vote[128];
SAFEPRINTF(vote, " %.78s\r\n", (char*)remsg.hfield_dat[i]);
SAFECAT(votes, vote);
}
answers++;
}
}
}
safe_snprintf(smsg, sizeof(smsg), smsgfmt
,timestr(cfg, msg->hdr.when_written.time, tstr)
,cfg->grp[cfg->sub[smb->subnum]->grp]->sname
,cfg->sub[smb->subnum]->sname
,from
,remsg.subj);
,remsg.subj
,votes);
putsmsg(cfg, user.number, smsg);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment