Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
6371c5df
Commit
6371c5df
authored
7 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Implemented support for multiple-answer polls/ballots.
parent
5a853927
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sbbs3/readmsgs.cpp
+9
-7
9 additions, 7 deletions
src/sbbs3/readmsgs.cpp
src/sbbs3/text.h
+3
-0
3 additions, 0 deletions
src/sbbs3/text.h
src/sbbs3/text_defaults.c
+4
-0
4 additions, 0 deletions
src/sbbs3/text_defaults.c
with
16 additions
and
7 deletions
src/sbbs3/readmsgs.cpp
+
9
−
7
View file @
6371c5df
...
@@ -1218,18 +1218,20 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
...
@@ -1218,18 +1218,20 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
ZERO_VAR
(
vote
);
ZERO_VAR
(
vote
);
if
(
msg
.
hdr
.
type
==
SMB_MSG_TYPE_POLL
)
{
if
(
msg
.
hdr
.
type
==
SMB_MSG_TYPE_POLL
)
{
unsigned
answers
=
0
;
str_list_t
answers
=
NULL
;
for
(
i
=
0
;
i
<
msg
.
total_hfields
;
i
++
)
{
for
(
i
=
0
;
i
<
msg
.
total_hfields
;
i
++
)
{
if
(
msg
.
hfield
[
i
].
type
!=
SMB_POLL_ANSWER
)
if
(
msg
.
hfield
[
i
].
type
==
SMB_POLL_ANSWER
)
continue
;
strListPush
(
&
answers
,
(
char
*
)
msg
.
hfield_dat
[
i
]);
uselect
(
1
,
answers
++
,
msg
.
subj
,
(
char
*
)
msg
.
hfield_dat
[
i
],
NULL
);
}
}
SAFEPRINTF
(
str
,
text
[
BallotHdr
],
msg
.
subj
);
i
=
uselect
(
0
,
0
,
NULL
,
NULL
,
NULL
);
i
=
mselect
(
str
,
answers
,
msg
.
hdr
.
votes
?
msg
.
hdr
.
votes
:
1
,
text
[
BallotAnswerFmt
]
if
(
i
<
0
)
{
,
text
[
PollAnswerChecked
],
nulstr
,
text
[
BallotVoteWhich
]);
strListFree
(
&
answers
);
if
(
i
<=
0
)
{
domsg
=
false
;
domsg
=
false
;
break
;
break
;
}
}
vote
.
hdr
.
votes
=
(
1
<<
i
)
;
vote
.
hdr
.
votes
=
i
;
vote
.
hdr
.
attr
=
MSG_VOTE
;
vote
.
hdr
.
attr
=
MSG_VOTE
;
notice
=
text
[
PollVoteNotice
];
notice
=
text
[
PollVoteNotice
];
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/text.h
+
3
−
0
View file @
6371c5df
...
@@ -801,6 +801,9 @@ enum {
...
@@ -801,6 +801,9 @@ enum {
,
PollAnswerNumber
,
PollAnswerNumber
,
PollAnswerFmt
,
PollAnswerFmt
,
PollAnswerChecked
,
PollAnswerChecked
,
BallotHdr
,
BallotAnswerFmt
,
BallotVoteWhich
,
TOTAL_TEXT
,
TOTAL_TEXT
};
};
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/text_defaults.c
+
4
−
0
View file @
6371c5df
...
@@ -1307,4 +1307,8 @@ const char * const text_defaults[TOTAL_TEXT]={
...
@@ -1307,4 +1307,8 @@ const char * const text_defaults[TOTAL_TEXT]={
,
"
\x01\x6e\x01\x63\x01\x68\x25\x32\x75\x01\x6e\x01\x63\x3a\x20
"
// 788 PollAnswerNumber
,
"
\x01\x6e\x01\x63\x01\x68\x25\x32\x75\x01\x6e\x01\x63\x3a\x20
"
// 788 PollAnswerNumber
,
"
\x25\x2d\x2a\x2e\x2a\x73\x20\x5b\x25\x2d\x34\x75\x20\x25\x33\x2e\x30\x66\x25\x25\x5d
"
// 789 PollAnswerFmt
,
"
\x25\x2d\x2a\x2e\x2a\x73\x20\x5b\x25\x2d\x34\x75\x20\x25\x33\x2e\x30\x66\x25\x25\x5d
"
// 789 PollAnswerFmt
,
"
\x20\xfb
"
// 790 PollAnswerChecked
,
"
\x20\xfb
"
// 790 PollAnswerChecked
,
"
\x01\x6e\x01\x6c\x01\x67\x42\x61\x6c\x6c\x6f\x74\x20\x66\x6f\x72\x20\x01\x68\x25\x73\x0d\x0a\x0d\x0a
"
// 791 BallotHdr
,
"
\x01\x6e\x01\x63\x01\x68\x25\x32\x75\x01\x6e\x01\x63\x3a\x20\x25\x2d\x2a\x2e\x2a\x73\x20\x01\x68\x25\x73\x0d\x0a
"
// 792 BallotAnswerFmt
,
"
\x0d\x0a\x54\x6f\x67\x67\x6c\x65\x20\x77\x68\x69\x63\x68\x20\x76\x6f\x74\x65\x20\x28\x75\x70\x20\x74\x6f\x20\x25\x75\x29\x2c\x20
"
"
\x7e\x51\x75\x69\x74\x20\x6f\x72\x20\x5b\x43\x61\x73\x74\x5d\x3a\x20
"
// 793 BallotVoteWhich
};
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment