Changeset 17930

Show
Ignore:
Timestamp:
08/20/08 17:17:46 (5 years ago)
Author:
syo68k
Message:

in_reply_to_status_idに関わる処理の見直し。フラグの戻し忘れ修正、in_reply_to_status_idを使う条件判定の追加。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/vb2005/Tween/Tween/Tween.vb

    r17903 r17930  
    5353    Private UrlDialog As New OpenURL 
    5454    Private Const _replyHtml As String = "@<a target=""_self"" href=""https://twitter.com/" 
    55     Private _reply_to As Integer         ' リプライ先のステータスID 0の場合はリプライではない 注:複数あてのものはリプライではない 
     55    Private _reply_to_id As Integer     ' リプライ先のステータスID 0の場合はリプライではない 注:複数あてのものはリプライではない 
     56    Private _reply_to_name As String    ' リプライ先ステータスの書き込み者の名前 
    5657 
    5758    Friend Class Win32Api 
     
    176177        _history.Add("") 
    177178        _hisIdx = 0 
    178         _reply_to = 0 
     179        _reply_to_id = 0 
     180        _reply_to_name = Nothing 
    179181 
    180182        '<<<<<<<<<設定関連>>>>>>>>> 
     
    14141416        Dim args As GetWorkerArg = CType(e.Argument, GetWorkerArg) 
    14151417        Try 
     1418            If args.type = WORKERTYPE.PostMessage Then CheckReplyTo(args.status) 
    14161419            For i As Integer = 0 To 1 
    14171420                Select Case args.type 
     
    14251428                        ret = clsTw.GetDirectMessage(tlList, args.page, args.endPage, Twitter.GetTypes.GET_DMSNT, TIconList.Images.Keys, imgs) 
    14261429                    Case WORKERTYPE.PostMessage 
    1427                         ret = clsTw.PostStatus(args.status, _reply_to) 
     1430                        ret = clsTw.PostStatus(args.status, _reply_to_id) 
    14281431                    Case WORKERTYPE.FavAdd 
    14291432                        ret = clsTw.PostFavAdd(args.ids(args.page)) 
     
    14311434                        ret = clsTw.PostFavRemove(args.ids(args.page)) 
    14321435                End Select 
     1436                If args.type = WORKERTYPE.PostMessage Then 
     1437                    _reply_to_id = 0 
     1438                    _reply_to_name = Nothing 
     1439                End If 
    14331440                If ret = "" Or (ret <> "" And (args.type = WORKERTYPE.PostMessage Or args.type = WORKERTYPE.FavAdd Or args.type = WORKERTYPE.FavRemove)) Then Exit For 
    14341441                Threading.Thread.Sleep(500) 
     
    50615068                    StatusText.SelectionStart = StatusText.Text.Length 
    50625069                    StatusText.Focus() 
    5063                     _reply_to = 0 
     5070                    _reply_to_id = 0 
     5071                    _reply_to_name = Nothing 
    50645072                    Exit Sub 
    50655073                End If 
     
    50675075                    ' ステータステキストが入力されていない場合先頭に@ユーザー名を追加する 
    50685076                    StatusText.Text = "@" + MyList.SelectedItems(0).SubItems(4).Text + " " 
    5069                     _reply_to = MyList.SelectedItems(0).SubItems(5).Text 
     5077                    _reply_to_id = MyList.SelectedItems(0).SubItems(5).Text 
     5078                    _reply_to_name = MyList.SelectedItems(0).SubItems(4).Text 
    50705079                Else 
    50715080                    If isAuto Then 
     
    50755084                                ' 複数リプライ 
    50765085                                StatusText.Text = StatusText.Text.Insert(2, "@" + MyList.SelectedItems(0).SubItems(4).Text + " ") 
    5077                                 _reply_to = 0 
     5086                                _reply_to_id = 0 
     5087                                _reply_to_name = Nothing 
    50785088                            Else 
    50795089                                ' 単独リプライ 
    50805090                                StatusText.Text = "@" + MyList.SelectedItems(0).SubItems(4).Text + " " + StatusText.Text 
    5081                                 _reply_to = MyList.SelectedItems(0).SubItems(5).Text 
     5091                                _reply_to_id = MyList.SelectedItems(0).SubItems(5).Text 
     5092                                _reply_to_name = MyList.SelectedItems(0).SubItems(4).Text 
    50825093                            End If 
    50835094                        Else 
    50845095                            ' 複数リプライ 
    50855096                            StatusText.Text = ". @" + MyList.SelectedItems(0).SubItems(4).Text + " " + StatusText.Text 
    5086                             _reply_to = 0 
     5097                            _reply_to_id = 0 
     5098                            _reply_to_name = Nothing 
    50875099                        End If 
    50885100                    Else 
     
    51015113                        StatusText.SelectionStart = sidx 
    51025114                        StatusText.Focus() 
    5103                         _reply_to = 0 
     5115                        _reply_to_id = 0 
     5116                        _reply_to_name = Nothing 
    51045117                        Exit Sub 
    51055118                    End If 
    51065119                End If 
    51075120            Else 
     5121                ' 複数リプライ 
    51085122                If isAuto = False And isReply = False Then Exit Sub 
    51095123 
     
    53745388        Try 
    53755389            '            For i As Integer = 0 To 2 
    5376             Select Case args.type 
    5377                 Case WORKERTYPE.PostMessage 
    5378                     ret = clsTwPost.PostStatus(args.status, _reply_to) 
    5379             End Select 
    5380             '            If ret.StartsWith("Err:") = False Then Exit For 
    5381             '           Threading.Thread.Sleep(500) 
    5382             '            Next 
    5383  
     5390            CheckReplyTo(args.status) 
     5391 
     5392            ret = clsTwPost.PostStatus(args.status, _reply_to_id) 
     5393 
     5394            _reply_to_id = 0 
     5395            _reply_to_name = Nothing 
    53845396            rslt.retMsg = ret 
    53855397            rslt.TLine = Nothing 
     
    57795791    End Sub 
    57805792    Friend Sub SetMainWindowTitle() 
     5793        'メインウインドウタイトルの書き換え 
     5794 
    57815795        If SettingDialog.DispUsername = True Then 
    57825796            'ユーザー名表示あり 
     
    57985812    End Sub 
    57995813    Friend Sub SetNotifyIconText() 
     5814        ' タスクトレイアイコンのツールチップテキスト書き換え 
     5815 
    58005816        If SettingDialog.DispUsername = True Then 
    58015817            NotifyIcon1.Text = _username + " - Tween" 
     
    58035819            NotifyIcon1.Text = "Tween" 
    58045820        End If 
     5821    End Sub 
     5822    Friend Sub CheckReplyTo(ByVal StatusText As String) 
     5823        ' 本当にリプライ先指定すべきかどうかの判定 
     5824        Dim id As New Regex("@[a-zA-Z0-9_]+") 
     5825        Dim m As MatchCollection 
     5826 
     5827        If _reply_to_id = 0 Then Exit Sub 
     5828 
     5829        If _reply_to_name = Nothing Then 
     5830            _reply_to_id = 0 
     5831            Exit Sub 
     5832        End If 
     5833 
     5834        m = id.Matches(StatusText) 
     5835 
     5836        If m.Count = 1 And m.Item(0).Value = "@" + _reply_to_name Then 
     5837            Exit Sub 
     5838        End If 
     5839 
     5840        _reply_to_id = 0 
     5841        _reply_to_name = Nothing 
     5842 
    58055843    End Sub 
    58065844End Class