Changeset 56

Show
Ignore:
Timestamp:
04/19/07 04:36:38 (21 months ago)
Author:
mayuki
Message:
 
Location:
TwitterIrcGateway
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • TwitterIrcGateway/TwitterIrcGateway/App.config

    r40 r56  
    2929                <value>True</value> 
    3030            </setting> 
     31            <setting name="SetTopicOnStatusChanged" serializeAs="String"> 
     32                <value>False</value> 
     33            </setting> 
    3134        </Misuzilla.Applications.TwitterIrcGateway.Settings> 
    3235    </userSettings> 
  • TwitterIrcGateway/TwitterIrcGateway/Program.cs

    r48 r56  
    5151            _server.ResolveTinyUrl = _settings.ResolveTinyUrl; 
    5252            _server.EnableDropProtection = _settings.EnableDropProtection; 
     53            _server.SetTopicOnStatusChanged = _settings.SetTopicOnStatusChanged; 
    5354            _server.SessionStartedRecieved += new EventHandler<SessionStartedEventArgs>(_server_SessionStartedRecieved); 
    5455            try 
  • TwitterIrcGateway/TwitterIrcGateway/Settings.Designer.cs

    r40 r56  
    107107            } 
    108108        } 
     109         
     110        [global::System.Configuration.UserScopedSettingAttribute()] 
     111        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 
     112        [global::System.Configuration.DefaultSettingValueAttribute("False")] 
     113        public bool SetTopicOnStatusChanged { 
     114            get { 
     115                return ((bool)(this["SetTopicOnStatusChanged"])); 
     116            } 
     117            set { 
     118                this["SetTopicOnStatusChanged"] = value; 
     119            } 
     120        } 
    109121    } 
    110122} 
  • TwitterIrcGateway/TwitterIrcGateway/Settings.settings

    r40 r56  
    2424      <Value Profile="(Default)">True</Value> 
    2525    </Setting> 
     26    <Setting Name="SetTopicOnStatusChanged" Type="System.Boolean" Scope="User"> 
     27      <Value Profile="(Default)">False</Value> 
     28    </Setting> 
    2629  </Settings> 
    2730</SettingsFile> 
  • TwitterIrcGateway/TwitterIrcGateway/TwitterIrcGateway.csproj

    r53 r56  
    3232    <ExcludedPermissions> 
    3333    </ExcludedPermissions> 
    34     <ApplicationIcon> 
    35     </ApplicationIcon> 
     34    <ApplicationIcon>Resources\ApplicationIcon.ico</ApplicationIcon> 
    3635  </PropertyGroup> 
    3736  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> 
  • TwitterIrcGateway/TwitterIrcGatewayCLI/Program.cs

    r53 r56  
    1616            Boolean enableDropProtection = true; 
    1717            Boolean ignoreWatchError = false; 
     18            Boolean setTopicOnStatusChanged = false; 
    1819            Int32 interval = 60; 
    1920            Int32 port = 16668; 
     
    4950                    { 
    5051                        resolveTinyUrl = true; 
     52                    } 
     53                } 
     54                else if (arg.StartsWith("--set-topic-onstatuschanged=")) 
     55                { 
     56                    if (!Boolean.TryParse(arg.Substring("--set-topic-onstatuschanged=".Length), out resolveTinyUrl)) 
     57                    { 
     58                        setTopicOnStatusChanged = false; 
    5159                    } 
    5260                } 
     
    8694            _server.EnableDropProtection = enableDropProtection; 
    8795            _server.Encoding = encoding; 
     96            _server.SetTopicOnStatusChanged = setTopicOnStatusChanged; 
    8897            _server.SessionStartedRecieved += new EventHandler<SessionStartedEventArgs>(_server_SessionStartedRecieved); 
    8998 
     
    94103            Console.WriteLine("[Configuration] ResolveTinyUrl: {0}", _server.ResolveTinyUrl); 
    95104            Console.WriteLine("[Configuration] Encoding: {0}", _server.Encoding.EncodingName); 
     105            Console.WriteLine("[Configuration] SetTopicOnStatusChanged: {0}", _server.SetTopicOnStatusChanged); 
    96106            Console.WriteLine("[Configuration] EnableDropProtection: {0}", _server.EnableDropProtection); 
    97107 
  • TwitterIrcGateway/TwitterIrcGatewayCore/Server.cs

    r50 r56  
    3333        /// </summary> 
    3434        public Boolean EnableDropProtection = true; 
     35 
     36        /// <summary> 
     37        /// �X�e�[�^�X��V�����Ƃ��Ƀg�s�b�N��X���邩�ǂ��� 
     38        /// </summary> 
     39        public Boolean SetTopicOnStatusChanged = false; 
    3540 
    3641        public const String ServerName = "localhost"; 
  • TwitterIrcGateway/TwitterIrcGatewayCore/Session.cs

    r55 r56  
    459459                    _twitter.UpdateStatus(message.Content); 
    460460                    _lastStatusFromGateway = message.Content; 
     461 
     462                    // topic �ɂ���                    if (_server.SetTopicOnStatusChanged) 
     463                    { 
     464                        TopicMessage topicMsg = new TopicMessage(Server.ChannelName, message.Content); 
     465                        topicMsg.Sender = _clientHost; 
     466                        Send(topicMsg); 
     467                    } 
    461468                } 
    462469                else 
     
    572579        void SendServerMessage(IRCMessage msg) 
    573580        { 
    574             msg.Sender = Server.ServerName; 
     581            msg.SenderNick = Server.ServerNick; 
     582            msg.SenderHost = Server.ServerName; 
    575583            Send(msg); 
    576584        }