Skip to content

Commit f89f870

Browse files
author
naveedm9
committed
Made g:vimchat_accounts optional.
git-svn-id: http://vimchat.googlecode.com/svn/trunk@141 d1d492a2-f496-11dd-9d1d-173cc1d06e3c
1 parent f8b0b5a commit f89f870

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

config

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
# edit and write this file and vimchat will update itself on the fly.
33
#
44
# Accounts entries are in the form: username@server/resource = password.
5-
# The /resource and password are optional. If you leave the password blank,
6-
# vimchat will prompt you for it when you connect. This accounts will be
7-
# connected to automatically when vimchat starts. You may connect or
8-
# disconnect from a particular account with \on and \off.
5+
# The '/resource' part of the account is optional. It is a jabber feature that
6+
# lets you associate physical locations with your accounts. The password is
7+
# optional as well. If you leave the password blank, vimchat will prompt you
8+
# for it when you connect. These accounts will be connected to automatically
9+
# when vimchat starts. You may connect or disconnect from a particular account
10+
# with \on and \off.
911

1012
[accounts]
1113
#bob@gmail.com =

plugin/vimchat.vim

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
"
1919
" Supported ~/.vimrc Variables:
2020
" g:vimchat_accounts = {'jabber id':'password',...}
21-
"
2221
" g:vimchat_buddylistwidth = width of buddy list
2322
" g:vimchat_libnotify = (0 or 1) default is 1
2423
" g:vimchat_logpath = path to store log files
2524
" g:vimchat_logchats = (0 or 1) default is 1
26-
" g:vimchat_otr = (0 or 1) default is 1
25+
" g:vimchat_otr = (0 or 1) default is 0
2726
" g:vimchat_logotr = (0 or 1) default is 1
2827
" g:vimchat_statusicon = (0 or 1) default is 1
2928

@@ -136,12 +135,10 @@ class VimChatScope:
136135
self.statusIcon.start()
137136

138137
# Signon to accounts listed in .vimrc
139-
vimChatAccounts = vim.eval('g:vimchat_accounts')
140-
for jid,password in vimChatAccounts.items():
141-
pass
142-
if password == '':
143-
password = vim.eval('inputsecret("' + jid + ' password: ")')
144-
self._signOn(jid,password)
138+
if vim.eval("exists('g:vimchat_accounts')") == '1':
139+
vimChatAccounts = vim.eval('g:vimchat_accounts')
140+
for jid,password in vimChatAccounts.items():
141+
self._signOn(jid,password)
145142

146143
# Signon to accounts listed in .vimchat/config
147144
if os.path.exists(self.configFilePath):
@@ -150,9 +147,6 @@ class VimChatScope:
150147
if config.has_section('accounts'):
151148
for jid in config.options('accounts'):
152149
password = config.get('accounts', jid)
153-
if not password:
154-
password = vim.eval(
155-
'inputsecret("' + jid + ' password: ")')
156150
self._signOn(jid, password)
157151

158152
#}}}
@@ -1637,10 +1631,6 @@ set switchbuf=usetab
16371631
"}}}
16381632
"{{{ VimChatCheckVars
16391633
fu! VimChatCheckVars()
1640-
if !exists('g:vimchat_accounts')
1641-
echo "Must set g:vimchat_accounts in ~/.vimrc!"
1642-
return 0
1643-
endif
16441634
if !exists('g:vimchat_buddylistwidth')
16451635
let g:vimchat_buddylistwidth=30
16461636
endif
@@ -1654,7 +1644,7 @@ fu! VimChatCheckVars()
16541644
let g:vimchat_logchats=1
16551645
endif
16561646
if !exists('g:vimchat_otr')
1657-
let g:vimchat_otr=1
1647+
let g:vimchat_otr=0
16581648
endif
16591649
if !exists('g:vimchat_logotr')
16601650
let g:vimchat_logotr=1

0 commit comments

Comments
 (0)