Commits

Shrikant Sharat Kandula committed c0f61a0

Removed unused/stale xml functions.

Comments (0)

Files changed (1)

plugin/twitvim.vim

 " === End of buffer stack code ===
 
 " Add update to Twitter buffer if public, friends, or user timeline.
-function! s:add_update(output)
+function! s:add_update(item)
     if has_key(s:curbuffer, 'buftype') && (
                 \ s:curbuffer.buftype == "public" ||
                 \ s:curbuffer.buftype == "friends" ||
                 \)
 
         " Parse the output from the Twitter update call.
-        let lines = s:format_status_xml(a:output)
+        let lines = s:format_status(a:item)
 
         " Line number where new tweet will be inserted. It should be 2 if
         " header is shown and 1 if header is hidden.
         let insline = s:curbuffer.showheader ? 2 : 1
 
-        " FIXME: Add the status ID to the current buffer's statuses list.
-        let item = 0
-        call insert(s:curbuffer.items, item, insline)
+        " Add the status ID to the current buffer's statuses list.
+        call insert(s:curbuffer.items, a:item, insline)
 
         let twit_bufnr = bufwinnr('^'.s:twit_winname.'$')
         if twit_bufnr > 0
     endif
 endfunction
 
-" Add update to Twitter buffer if public, friends, or user timeline.
-function! s:add_update_json(item)
-    if has_key(s:curbuffer, 'buftype') && (
-                \ s:curbuffer.buftype == "public" ||
-                \ s:curbuffer.buftype == "friends" ||
-                \ s:curbuffer.buftype == "user" ||
-                \ s:curbuffer.buftype == "replies" ||
-                \ s:curbuffer.buftype == "list" ||
-                \ s:curbuffer.buftype == "retweeted_by_me" ||
-                \ s:curbuffer.buftype == "retweeted_to_me"
-                \)
-
-        " Parse the output from the Twitter update call.
-        let lines = s:format_status(a:item)
-
-        " Line number where new tweet will be inserted. It should be 2 if
-        " header is shown and 1 if header is hidden.
-        let insline = s:curbuffer.showheader ? 2 : 1
-
-        " Add the status ID to the current buffer's statuses list.
-        call insert(s:curbuffer.items, a:item, insline)
-
-        let twit_bufnr = bufwinnr('^'.s:twit_winname.'$')
-        if twit_bufnr > 0
-            let curwin = winnr()
-            execute twit_bufnr . "wincmd w"
-            setlocal modifiable
-            call append(insline - 1, lines)
-            execute "normal! ".insline."G"
-            setlocal nomodifiable
-            let s:curbuffer.buffer = getline(1, '$')
-            execute curwin .  "wincmd w"
-        endif
-    endif
-endfunction
-
 " Count number of characters in a multibyte string. Use technique from
 " :help strlen().
 function! s:mbstrlen(s)
         if !empty(error) || has_key(response, 'error')
             call s:errormsg("Error posting your tweet: " . (empty(error) ? response.error : error))
         else
-            call s:add_update_json(response)
+            call s:add_update(response)
             redraw
             echo "Your tweet was sent. You used " . mesglen . " characters."
         endif
         call s:errormsg("Error retweeting: ".(empty(error) ? response.error : error))
         return
     endif
-    call s:add_update_json(response)
+    call s:add_update(response)
     redraw
     echo "Retweeted."
 endfunction
 endfunction
 
 " Format XML status as a display line.
-function! s:format_status_xml(item)
-    let item = a:item
-
-    " Quick hack. Even though we're getting new-style retweets in the timeline
-    " XML, we'll still use the old-style retweet text from it.
-    let item = s:xml_remove_elements(item, 'retweeted_status')
-
-    let user = s:xml_get_element(item, 'screen_name')
-    let text = s:format_retweeted_status(a:item)
-    if text == ''
-        let text = s:convert_entity(s:get_status_text(item))
-    endif
-    let pubdate = s:time_filter(s:xml_get_element(item, 'created_at'))
-
-    return [user.' |'.pubdate.'|', '   '.text]
-endfunction
-
-" Format XML status as a display line.
+" format_status_xml used to be here, not anymore.
 function! s:format_status(item)
     let item = a:item
     let pubdate = s:time_filter(item.created_at)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.