Mercurial > libervia-web
comparison src/server/blog.py @ 487:e588335b6aa8
browser and server side: force lower case for the profile name at new account creation + fixes CSS for textarea
author | souliane <souliane@mailoo.org> |
---|---|
date | Thu, 19 Jun 2014 19:28:17 +0200 |
parents | ae86b32b959c |
children | 3eb3a2c0c011 7af8f4ab3675 |
comparison
equal
deleted
inserted
replaced
486:600a71743072 | 487:e588335b6aa8 |
---|---|
67 @param value (str): entity data value | 67 @param value (str): entity data value |
68 @param dummy (str): that would be C.SERVICE_PROFILE | 68 @param dummy (str): that would be C.SERVICE_PROFILE |
69 """ | 69 """ |
70 if key != 'avatar': | 70 if key != 'avatar': |
71 return | 71 return |
72 entity_jid_s = entity_jid_s.lower() | |
72 log.debug(_("Received a new avatar for entity %s") % entity_jid_s) | 73 log.debug(_("Received a new avatar for entity %s") % entity_jid_s) |
73 avatar = C.AVATARS_DIR + value | 74 avatar = C.AVATARS_DIR + value |
74 self.avatars_cache[entity_jid_s] = avatar | 75 self.avatars_cache[entity_jid_s] = avatar |
75 try: | 76 try: |
76 self.waiting_deferreds[entity_jid_s][1].callback(avatar) | 77 self.waiting_deferreds[entity_jid_s][1].callback(avatar) |
103 """Get the avatar of the given profile | 104 """Get the avatar of the given profile |
104 | 105 |
105 @param profile (str): | 106 @param profile (str): |
106 @return: deferred avatar path, relative to the server's root | 107 @return: deferred avatar path, relative to the server's root |
107 """ | 108 """ |
108 jid_s = profile + '@' + self.host.bridge.getNewAccountDomain() | 109 jid_s = (profile + '@' + self.host.bridge.getNewAccountDomain()).lower() |
109 if jid_s in self.avatars_cache: | 110 if jid_s in self.avatars_cache: |
110 return defer.succeed(self.avatars_cache[jid_s]) | 111 return defer.succeed(self.avatars_cache[jid_s]) |
111 # FIXME: request_id is no more need when actionResult is removed | 112 # FIXME: request_id is no more need when actionResult is removed |
112 request_id = self.host.bridge.getCard(jid_s, C.SERVICE_PROFILE) | 113 request_id = self.host.bridge.getCard(jid_s, C.SERVICE_PROFILE) |
113 self.waiting_deferreds[jid_s] = (request_id, defer.Deferred()) | 114 self.waiting_deferreds[jid_s] = (request_id, defer.Deferred()) |