Changeset 672

Show
Ignore:
Timestamp:
10/26/09 08:30:48 (11 months ago)
Author:
tomoyo
Message:

* 140文字を超えた時送信しないでエラーを返すようにした
* re のときは先にエコーバックしてしまうようにした

Location:
TwitterIrcGateway/branches/hosting/TwitterIrcGatewayCore
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • TwitterIrcGateway/branches/hosting/TwitterIrcGatewayCore/AddIns/TypableMap/TypableMapCommandProcessor.cs

    r670 r672  
    265265                } 
    266266 
    267                  String replyMsg = String.Format("@{0} {1}", status.User.ScreenName, args); 
     267                String replyMsg = String.Format("@{0} {1}", status.User.ScreenName, args); 
     268                 
     269                // 入力が発言されたチャンネルには必ずエコーバックする。 
     270                // 先に出しておかないとundoがよくわからなくなる。 
     271                session.SendChannelMessage(msg.Receiver, session.CurrentNick, replyMsg, true, false, false, false); 
    268272                session.UpdateStatusWithReceiverDeferred(msg.Receiver, replyMsg, status.Id, (updatedStatus) => 
    269273                                                                                                { 
    270                                                                                                     // 入力が発言されたチャンネルには必ずエコーバックする。 
    271                                                                                                     session.SendChannelMessage(msg.Receiver, session.CurrentNick, updatedStatus.Text, true, false, false, false); 
    272274                                                                                                }); 
    273275                return true; 
  • TwitterIrcGateway/branches/hosting/TwitterIrcGatewayCore/Session.cs

    r671 r672  
    825825                { 
    826826                    String postMessage = message; 
     827                     
     828                    // 140文字制限のチェック 
     829                    if (message.Length > 140) 
     830                    { 
     831                        Int32 overCharCount = message.Length - 140; 
     832                        SendChannelMessage(receiver, Server.ServerNick, 
     833                                           String.Format("140文字を超えたメッセージの送信は出来ません。{0}文字の超過です。(場所: {1}...)", overCharCount, message.Substring(140, Math.Min(5, overCharCount))), true, false, false, true); 
     834                        return false; 
     835                    } 
     836                     
    827837                    try 
    828838                    {