tiix dev started
This commit is contained in:
+3
-5
@@ -28,12 +28,10 @@ proc readfile {fname} {
|
||||
}
|
||||
|
||||
# main data posting function
|
||||
proc postiidata {rooturl authstr echoname msgto subj repto text add_enc} {
|
||||
proc postiidata {rooturl authstr echoname msgto subj repto text} {
|
||||
if {$repto ne ""} {set text "@repto:$repto\r\n$text"}
|
||||
set rawdata "$echoname\n$msgto\n$subj\n\n$text"
|
||||
if {$add_enc eq 1} {
|
||||
set rawdata [encoding convertto utf-8 $rawdata]
|
||||
}
|
||||
set rawdata [encoding convertto utf-8 $rawdata]
|
||||
set based [binary encode base64 $rawdata]
|
||||
# perform the posting if the length fits
|
||||
if {[string length $based] <= 87382} {
|
||||
@@ -95,7 +93,7 @@ if {$argc > 3} {
|
||||
}
|
||||
set msgtext [readfile stdin]
|
||||
puts "Posting the message to $sturl..."
|
||||
set res [postiidata $sturl $authstr $echoname $msgto $subj $repto $msgtext 1]
|
||||
set res [postiidata $sturl $authstr $echoname $msgto $subj $repto $msgtext]
|
||||
set status [dict get $res status]
|
||||
set result [dict get $res result]
|
||||
if {$status} {puts "Success: $result"} else {puts "Error: $result"}
|
||||
|
||||
Reference in New Issue
Block a user