Get instrumental case for name in chat buffers. Remove set Offline option in VK at exit

This commit is contained in:
Manuel Cortez 2016-07-07 14:50:09 -05:00
parent 519381684d
commit bab896aba1
2 changed files with 8 additions and 3 deletions

View File

@ -315,7 +315,7 @@ class Controller(object):
buffer = buffers.chatBuffer(parent=self.window.tb, name="{0}_messages".format(user_id,), composefunc="compose_message", session=self.session, count=200, user_id=user_id, rev=1)
self.buffers.append(buffer)
# Translators: {0} will be replaced with an user.
self.window.insert_buffer(buffer.tab, _(u"Chat with {0}").format(self.session.get_user_name(user_id,)), self.window.search("chats"))
self.window.insert_buffer(buffer.tab, _(u"Chat with {0}").format(self.session.get_user_name(user_id, "ins")), self.window.search("chats"))
if setfocus:
pos = self.window.search(buffer.name)
self.window.change_buffer(pos)

View File

@ -331,10 +331,15 @@ class vkSession(object):
gids = "{0},".format(i["id"],)
if not "ru" in languageHandler.getLanguage():
return
users = self.vk.client.users.get(user_ids=ids, fields="first_name, last_name", name_case="gen")
for i in users:
users_genitive = self.vk.client.users.get(user_ids=ids, fields="first_name, last_name", name_case="gen")
users_instrumental = self.vk.client.users.get(user_ids=ids, fields="first_name, last_name", name_case="ins")
for i in users_genitive:
if self.db["users"].has_key(i["id"]):
self.db["users"][i["id"]]["gen"] = u"{0} {1}".format(i["first_name"], i["last_name"])
for i in users_instrumental:
if self.db["users"].has_key(i["id"]):
self.db["users"][i["id"]]["ins"] = u"{0} {1}".format(i["first_name"], i["last_name"])
def get_my_data(self):
log.debug("Getting user identifier...")