'From Squeak3.4beta of ''1 December 2002'' [latest update: #5147] on 10 December 2002 at 12:07:11 am'! "Change Set: CelesteCleanUp4 Date: 9 December 2002 Author: Daniel Vainsencher Redefine Celeste clients to use MailSender, so their dependency on Celeste is gone."! !Celeste class methodsFor: 'class initialization' stamp: 'dvf 12/9/2002 19:22'! initialize "Celeste initialize" "user preferences" CCList _ nil. DeleteInboxAfterFetching _ false. PopServer _ nil. PopUserName _ nil. SuppressWorthlessHeaderFields _ true. "options with no UI; just set their values directly" FormatWhenFetching _ false. "dictionary of custom filters" CustomFilters _ Dictionary new. MessageCountLimit _ 200. "Add global preferences" Preferences addPreferenceForOptionalCelesteStatusPane. Preferences addPreferenceForCelesteShowingAttachmentsFlag. ! ! !ChangeSet methodsFor: 'fileIn/Out' stamp: 'dvf 5/11/2002 00:45'! mailOut "Email a compressed version of this changeset to the squeak-dev list, so that it can be shared with everyone. (You will be able to edit the email before it is sent.)" | userName message slips | userName _ MailSender userName. self checkForConversionMethods. Cursor write showWhile: [message _ self buildMessageForMailOutWithUser: userName]. MailSender sendMessage: message. Preferences suppressCheckForSlips ifTrue: [^ self]. slips _ self checkForSlips. (slips size > 0 and: [self confirm: 'Methods in this fileOut have halts or references to the Transcript or other ''slips'' in them. Would you like to browse them?']) ifTrue: [Smalltalk browseMessageList: slips name: 'Possible slips in ' , name] ! ! !Debugger methodsFor: 'context stack menu' stamp: 'dvf 5/11/2002 00:51'! mailOutBugReport "Compose a useful bug report showing the state of the process as well as vital image statistics as suggested by Chris Norton - 'Squeak could pre-fill the bug form with lots of vital, but oft-repeated, information like what is the image version, last update number, VM version, platform, available RAM, author...' and address it to the list with the appropriate subject prefix." | messageStrm | MailSender default ifNil: [^self]. Cursor write showWhile: ["Prepare the message" messageStrm _ WriteStream on: (String new: 1500). messageStrm nextPutAll: 'From: '; nextPutAll: MailSender userName; cr; nextPutAll: 'To: squeak-dev@lists.squeakfoundation.org'; cr; nextPutAll: 'Subject: '; nextPutAll: '[BUG]'; nextPutAll: self interruptedContext printString; cr;cr; nextPutAll: 'here insert explanation of what you were doing, suspect changes you''ve made and so forth.';cr;cr. self interruptedContext errorReportOn: messageStrm. MailSender sendMessage: (MailMessage from: messageStrm contents)]. ! ! !HTTPClient class methodsFor: 'utilities' stamp: 'dvf 6/15/2002 19:18'! tellAFriend: emailAddressOrNil url: urlForLoading name: projectName | recipient subject body linkToInclude | recipient _ emailAddressOrNil ifNil: ['RECIPIENT.GOESHERE']. subject _ 'New/Updated Squeak project'. body _ 'This is a link to the Squeak project ' , projectName , ': ' , SimpleClientSocket crLf. linkToInclude _ urlForLoading. HTTPClient shouldUsePluginAPI ifTrue: [ self composeMailTo: recipient subject: subject body: body , (linkToInclude copyReplaceAll: '%' with: '%25')] ifFalse: [Preferences allowCelesteTell ifTrue: [FancyMailComposition new celeste: nil to: recipient subject: subject initialText: body theLinkToInclude: linkToInclude; open] ifFalse: [self inform: 'You need to run inside a web browser to use the tell function.']]! ! !MailtoUrl methodsFor: 'downloading' stamp: 'dvf 5/11/2002 00:47'! activate "Activate a Celeste window for the receiver" MailSender sendMessage: (MailMessage from: self composeText)! ! !MailtoUrl methodsFor: 'downloading' stamp: 'dvf 5/11/2002 01:00'! composeText "Answer the template for a new message." ^ String streamContents: [:str | str nextPutAll: 'From: '. str nextPutAll: MailSender userName; cr. str nextPutAll: 'To: '. str nextPutAll: locator asString; cr. str nextPutAll: 'Subject: '; cr. str cr].! ! Celeste initialize! Celeste class removeSelector: #isSmtpServerSet! Celeste class removeSelector: #setSmtpServer! Celeste class removeSelector: #setUserName! Celeste class removeSelector: #smtpServer! Celeste class removeSelector: #userName!