Skip to content

Commit

Permalink
everything works and i know why
Browse files Browse the repository at this point in the history
  • Loading branch information
gitjannes committed Jun 27, 2024
1 parent 8557bd4 commit ba0e6f6
Show file tree
Hide file tree
Showing 32 changed files with 156 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sending
sendPollMessage: aPollType asking: aString with: anOrderedCollection isAnonymous: aBoolean

self core send: (TCCRequest newSendPollMessage: aPollType to: (self id) asking: aString with: anOrderedCollection isAnonymous: aBoolean).
self selectedReplyToMessageId: self class defaultSelectedReplyToMessageId.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"sendDocumentMessage:" : "ED 6/19/2024 13:53",
"sendMessage:" : "JK 5/28/2024 09:53",
"sendPhotoMessage:" : "ED 6/19/2024 12:11",
"sendPollMessage:" : "jkon 6/26/2024 10:50",
"sendPollMessage:asking:with:isAnonymous:" : "jkon 6/27/2024 20:35",
"sendStickerMessage:" : "JK 5/28/2024 10:26",
"sendVideoMessage:" : "ED 6/19/2024 12:23",
"stillRequestedMessages" : "ek 8/4/2022 11:38",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ newSendPhotoMessage: aPhotoPath to: aChatId
^ TCCRequest
newWithType: 'sendMessage'
from: {
'chat_id' -> 'aChatId'.
'chat_id' -> aChatId.
'input_message_content' -> (Dictionary newFrom: {
'@type' -> 'inputMessagePhoto'.
'photo' -> (Dictionary newFrom: {
'@type' -> 'inputFileLocal'.
'path' -> 'aPhotoPath'.
'path' -> aPhotoPath.
})
})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
instance creation
newSendPollMessage: aPollType to: aChatId asking: aString with: anOptionOrderedCollection isAnonymous: aBoolean

^ (TCCRequest
newWithType: 'sendMessage'
from: {
'chat_id' -> aChatId.
'input_message_content' -> (Dictionary newFrom: {
'@type' -> 'inputMessagePoll'.
'question' -> aString.
'options' -> anOptionOrderedCollection.
'is_anonymous' -> false.
'type' ->(self selectJsonFor: aPollType).
}).
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
as yet unclassified
selectJsonFor: aPollType

^ aPollType caseOf: {
['regular'] -> [(Dictionary newFrom: {'@type' -> 'pollTypeRegular'.
'allow_multiple_answers' -> false. })].
['multiple'] -> [(Dictionary newFrom: {'@type' -> 'pollTypeRegular'.
'allow_multiple_answers' -> true. })].
['quiz'] -> [(Dictionary newFrom: {'@type' -> 'pollTypeQuiz'. 'correct_option_id' -> 0. })]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
"newSendMessage:to:" : "6/7/2024 09:02:10",
"newSendMessage:to:asReplyTo:" : "JS 5/20/2022 10:02",
"newSendPhoneNumber:" : "RS 6/23/2021 16:34",
"newSendPhotoMessage:to:" : "jkon 6/26/2024 16:50",
"newSendPollMessage:to:" : "jkon 6/26/2024 16:56",
"newSendPhotoMessage:to:" : "jkon 6/27/2024 09:20",
"newSendPollMessage:to:asking:with:isAnonymous:" : "jkon 6/27/2024 20:31",
"newSendStickerMessage:to:" : "JK 6/21/2024 14:08",
"newSendVideoMessage:to:" : "ED 6/19/2024 12:22",
"newSetPollAnswer:message:options:" : "TU 6/6/2024 01:15",
"newUser:" : "JB 8/1/2021 11:55",
"newWithType:from:" : "rs 6/6/2020 16:21" },
"newWithType:from:" : "rs 6/6/2020 16:21",
"selectJsonFor:" : "jkon 6/27/2024 14:35" },
"instance" : {
"asString" : "js 8/1/2020 12:16" } }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ newFor: aChat withBounds: aRectangle

^ (super newBounds: aRectangle)
chat: aChat;
allInputFields: (OrderedCollection new);
addTypeOption;
yourself
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
drawing
addChoices: aRectangle

aRectangle addMorph: (TCUChoice newFor: 'Anonymous Poll?');
addMorph: (TCUChoiceExclusive newFor: 'Standard Poll' inPoll: self);
addMorph: (TCUChoiceExclusive newFor: 'Multiple Options' inPoll: self);
addMorph: (TCUChoiceExclusive newFor: 'Quiz' inPoll: self).
self createAnonymousChoice.

aRectangle addMorph: self anonymousChoice;
addMorph: ((TCUChoiceExclusive newFor: 'Standard Poll' inPoll: self)
name: 'regular';
yourself);
addMorph: ((TCUChoiceExclusive newFor: 'Multiple Options' inPoll: self)
name: 'multiple';
yourself);
addMorph: ((TCUChoiceExclusive newFor: 'Quiz' inPoll: self)
name: 'quiz';
yourself).
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ addInputFieldFor: aRectangle
color: Color white;
contentsWrapped: '' asText;
extent: 200 @ 20;
"crAction: [self buttonSendPressed];
" yourself).
"crAction: [self buttonSendPressed];"
yourself).
self allInputFields add: inputField.
aRectangle addMorph: inputField.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
allInputFields: anOrderedCollection

allInputFields:= anOrderedCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
allInputFields

^ allInputFields
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
anonymousChoice: aChoice

anonymousChoice := aChoice
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
anonymousChoice

^ anonymousChoice
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
event handling
confirmPressed

self chat sendPollMessage: 'babbing'.
self question: (self allInputFields at: 1) contents asString withBlanksTrimmed squeakToUtf8.
self getOptions.
(self question) ifNotEmpty: [self chat sendPollMessage: (self pollType) asking: (self question) with: (self options) isAnonymous: (self isAnonymous)].
self abandon.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
createAnonymousChoice

self anonymousChoice: (TCUChoice newFor: 'Anonymous Poll?').
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
as yet unclassified
getOptions

self options: (OrderedCollection new).
self options add: (self allInputFields at: 2) contents asString withBlanksTrimmed squeakToUtf8.
self options add: (self allInputFields at: 3) contents asString withBlanksTrimmed squeakToUtf8.
self options add: (self allInputFields at: 4) contents asString withBlanksTrimmed squeakToUtf8.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
isAnonymous: aBoolean

isAnonymous := aBoolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
isAnonymous

^ isAnonymous
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
event handling
nextPressed

self isAnonymous: self anonymousChoice isSelected.
self pollType: (self currentSelection) name.
self typeOption abandon.
self createNameSetter.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
options: anOrderedCollection

options := anOrderedCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
options

^ options
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
pollType: aString

pollType := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
pollType

^ pollType
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
question: aString

question := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
question

^ question
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
{
"class" : {
"newFor:withBounds:" : "jkon 6/17/2024 11:14" },
"newFor:withBounds:" : "jkon 6/27/2024 20:14" },
"instance" : {
"addChoices" : "6/24/2024 10:41:19",
"addChoices:" : "jkon 6/19/2024 21:34",
"addChoices:" : "jkon 6/27/2024 19:24",
"addConfirmButton:" : "jkon 6/18/2024 10:05",
"addInputFieldFor:" : "jkon 6/19/2024 21:44",
"addInputFieldFor:" : "jkon 6/27/2024 20:15",
"addNextButton:" : "jkon 6/19/2024 18:50",
"addTextFieldFor:with:" : "jkon 6/18/2024 13:31",
"addTextInputFor:" : "jkon 6/19/2024 21:41",
"addTypeOption" : "jkon 6/19/2024 21:29",
"allInputFields" : "jkon 6/27/2024 20:13",
"allInputFields:" : "jkon 6/27/2024 20:14",
"anonymousChoice" : "jkon 6/27/2024 19:03",
"anonymousChoice:" : "jkon 6/27/2024 19:03",
"chat" : "jkon 6/17/2024 10:29",
"chat:" : "jkon 6/17/2024 10:29",
"clear" : "jkon 6/18/2024 13:40",
"confirmPressed" : "jkon 6/26/2024 10:54",
"confirmPressed" : "jkon 6/27/2024 20:32",
"createAnonymousChoice" : "jkon 6/27/2024 19:02",
"createNameSetter" : "jkon 6/19/2024 21:33",
"createTypeOption" : "jkon 6/19/2024 21:48",
"currentSelection" : "jkon 6/19/2024 18:39",
"currentSelection:" : "jkon 6/19/2024 18:40",
"getOptions" : "jkon 6/27/2024 20:32",
"initialize" : "jkon 6/18/2024 13:39",
"isAnonymous" : "jkon 6/27/2024 19:14",
"isAnonymous:" : "jkon 6/27/2024 19:13",
"newSelection:" : "jkon 6/19/2024 18:39",
"nextPressed" : "jkon 6/19/2024 18:51",
"nextPressed" : "jkon 6/27/2024 19:27",
"options" : "jkon 6/27/2024 14:47",
"options:" : "jkon 6/27/2024 14:47",
"pollType" : "jkon 6/27/2024 14:46",
"pollType:" : "jkon 6/27/2024 14:46",
"question" : "jkon 6/27/2024 14:46",
"question:" : "jkon 6/27/2024 14:47",
"typeOption" : "jkon 6/17/2024 11:03",
"typeOption:" : "jkon 6/17/2024 11:03" } }
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
"selectionMorph",
"textMorph",
"isSelected",
"currentSelection" ],
"currentSelection",
"pollType",
"question",
"options",
"anonymousChoice",
"isAnonymous",
"allInputFields" ],
"name" : "TCUChatPollEditor",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"addTextInputField" : "jkon 6/17/2024 09:58",
"addTitleBar" : "RS 5/29/2021 18:12",
"addWelcomeMessage" : "RK 8/4/2021 12:07",
"buttonFileSelectPressed" : "ED 6/19/2024 13:54",
"buttonFileSelectPressed" : "jkon 6/27/2024 09:15",
"buttonSendPressed" : "ek 6/19/2022 19:07",
"buttonStickerPressed" : "AH 6/23/2024 13:00",
"chatMessageList" : "JB 7/6/2021 14:02",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
name: aString

name := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
name

^ name
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"isExclusive:" : "6/24/2024 10:41:19",
"isSelected" : "jkon 6/17/2024 14:52",
"isSelected:" : "jkon 6/17/2024 14:52",
"name" : "jkon 6/27/2024 19:30",
"name:" : "jkon 6/27/2024 19:30",
"selectionMorph" : "jkon 6/17/2024 15:20",
"selectionMorph:" : "jkon 6/17/2024 15:20",
"updateChoice" : "jkon 6/18/2024 10:03" } }
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"isSelected",
"content",
"isExclusive",
"poll" ],
"poll",
"name" ],
"name" : "TCUChoice",
"pools" : [
],
Expand Down

0 comments on commit ba0e6f6

Please sign in to comment.