core, frontends, bridgen plugins: fixed methods which were unproperly managing multi-profiles
- added profile argument to askConfirmation, actionResult, actionResultExt, entityDataUpdated, confirmationAnswer, getProgress
- core, frontends: fixed calls/signals according to new bridge API
- user of proper profile namespace for progression indicators and dialogs
- memory: getParam* now return bool when param type is bool
- memory: added getStringParam* to return string instead of typed value
- core, memory, storage, quick_frontend: getHistory now manage properly multi-profiles
- plugins XEP-0047, XEP-0054, XEP-0065, XEP-0077, XEP-0096; multi-profiles proper handling
This commit is contained in:
parent
49437fd9c3
commit
fa38394401
20 changed files with 570 additions and 400 deletions
|
|
@ -183,7 +183,7 @@ class SqliteStorage():
|
|||
@param _type: message type (see RFC 6121 §5.2.2)
|
||||
@param timestamp: timestamp in seconds since epoch, or None to use current time
|
||||
"""
|
||||
assert(profile!=None)
|
||||
assert(profile)
|
||||
d = self.dbpool.runQuery("INSERT INTO history(source, source_res, dest, dest_res, timestamp, message, type, profile_id) VALUES (?,?,?,?,?,?,?,?)",
|
||||
(from_jid.userhost(), from_jid.resource, to_jid.userhost(), to_jid.resource, timestamp or time.time(),
|
||||
message, _type, self.profiles[profile]))
|
||||
|
|
@ -191,12 +191,13 @@ class SqliteStorage():
|
|||
{"from_jid":from_jid.full(), "to_jid":to_jid.full(), "message":message})))
|
||||
return d
|
||||
|
||||
def getHistory(self, from_jid, to_jid, limit=0, between=True):
|
||||
def getHistory(self, from_jid, to_jid, limit=0, between=True, profile=None):
|
||||
"""Store a new message in history
|
||||
@param from_jid: source JID (full, or bare for catchall
|
||||
@param to_jid: dest JID (full, or bare for catchall
|
||||
@param size: maximum number of messages to get, or 0 for unlimited
|
||||
"""
|
||||
assert(profile)
|
||||
def sqliteToDict(query_result):
|
||||
query_result.reverse()
|
||||
result = []
|
||||
|
|
@ -208,8 +209,8 @@ class SqliteStorage():
|
|||
return result
|
||||
|
||||
|
||||
query_parts = ["SELECT timestamp, source, source_res, dest, dest_res, message, type FROM history WHERE"]
|
||||
values = []
|
||||
query_parts = ["SELECT timestamp, source, source_res, dest, dest_res, message, type FROM history WHERE profile_id=? AND"]
|
||||
values = [self.profiles[profile]]
|
||||
|
||||
def test_jid(_type,_jid):
|
||||
values.append(_jid.userhost())
|
||||
|
|
|
|||
Loading…
Reference in a new issue